Re: Set Crystal Report Namespace

From: Mythran (kip_potter_at_hotmail.comREMOVETRAIL)
Date: 12/01/04


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



Relevant Pages

  • Re: Set Crystal Report Namespace
    ... how can I go about and set a Crystal Reports namespace? ... >> they use the Root Namespace from the project. ... report. ... The Crystal Report file should go under the correct namespace in the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Set Crystal Report Namespace
    ... how can I go about and set a Crystal Reports namespace? ... >> they use the Root Namespace from the project. ... report. ... The Crystal Report file should go under the correct namespace in the ...
    (microsoft.public.vb.crystal)
  • Re: VERY IMPORTANT: Sharing
    ... Thanks for correcting the typo. ... --- then userB although trying to view ReportB will see ReportA... ... I have report name as a string property called strReportName that keeps track of the report name. ... >> Namespace FinancialCompany.Portal ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: namespaces in unit names in D7
    ... probably an undocumented feature? ... > I have seen a report on QC where code completion would add the own unit ... > namespace supported is limited on D7. ...
    (borland.public.delphi.non-technical)
  • Re: Modify a SQL Expression Field from Visual Basic
    ... though I can view data in the report. ... Dim sResult As String ... ' 'SetPrivateData sets the recordset data to the report in memory ... Crystal Report Engine 8.0 Object Library, ...
    (microsoft.public.vb.crystal)