Set Crystal Report Namespace

M

Mythran

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
 
M

Mythran

Thomas Wenning said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top