Re: Set Crystal Report Namespace
From: Mythran (kip_potter_at_hotmail.comREMOVETRAIL)
Date: 12/01/04
- Next message: Willy Denoyette [MVP]: "Re: Serial connection behavior C#"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Executing an application inside a Service"
- In reply to: Thomas Wenning: "Re: Set Crystal Report Namespace"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Dec 2004 09:50:04 -0800
"Thomas Wenning" <nospam.thomas.wenning@gmx.de> wrote in message
news:%23EyQDu41EHA.1204@TK2MSFTNGP10.phx.gbl...
>
> "Mythran" <kip_potter@hotmail.comREMOVETRAIL> schrieb im Newsbeitrag
> news:OhA$kMw1EHA.1524@TK2MSFTNGP09.phx.gbl...
>> In .Net, how can I go about and set a Crystal Reports namespace? Right
> now
>> they use the Root Namespace (VB) from the project. How can I extend the
>> namespace for a single report (which will be set on all reports)?
>>
>> Thanks for any and all help, in advance :)
>>
>> Mythran
>>
>>
>
> Hi Mythran,
>
> Crystal Reports provides the following namespaces:
> http://blogs.aspadvice.com/crystal/archive/2004/03/31/884.aspx
>
> Greeting
>
> Thomas
>
>
Sorry, don't think I was clear enough. I have a strongly typed crystal
report (created in the .Net IDE so it's CR.Net). Right now I have to use
the project's namespace to access the report (Ex:
MyCompany.MyProjectType.MyCrystalReport). I want to set it to have
MyCompany.MyProjectType.MyReports.MyCrystalReport but it won't let me.
After viewing the manifest of the assembly when I set the Custom Tool
Namespace property, I see that the code file for the report (*.vb) is under
the correct namespace that I want but the report file itself is under the
project root namespace. Therefore, I believe this to be a bug in either the
.Net compiler or the CR.Net framework...
The Crystal Report file (*.rpt) should go under the correct namespace in the
assembly manifest that I define using the Custom Tool Namespace, or there
should be some way of setting the namespace that the report should go under.
To reproduce what I'm trying to do and the exception I'm getting:
Create new Web Project.
Add a Crystal Report.
Select the Crystal Report under the Solution Explorer and right-click it.
Click Properties
Change the "Custom Tool Namespace" to "Reports".
In code, create the report and export it (report.ExportToDisk(pdfenumtype,
"C:\sample.pdf")).
Build and then test it.
Intellisense works fine and shows the report as being under <project root
namespace>.Reports.<report name> but an exception is thrown that states the
report is not in the assembly manifest. The report IS there, but not with
the same name (or namespace). To test how I came to this conclusion:
Dim asm As Reflection.Assembly = Reflection.Assembly.GetAssembly( _
GetType(<nameofthisclass>) _
)
Dim names As String() = asm.GetManifestResourceNames()
For Each name As String In names
Console.WriteLine(name)
Next
Change <nameofthisclass> to the class name of the class which contains the
above sample code :)
Anywho, hope this helps explain a bit more :)
Mythran
- Next message: Willy Denoyette [MVP]: "Re: Serial connection behavior C#"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Executing an application inside a Service"
- In reply to: Thomas Wenning: "Re: Set Crystal Report Namespace"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|