Avatar of dwp_raj
dwp_raj asked on

problum in exporting crystalreport

I generated a crystalreport with "dataset1.xsd" The report displaying records.the problum is while exporting report in .xsl format it is giving following error
>>Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\Rambabu\LOCALS~1\Temp\temp_9fdc4f14-b9f8-44ac-8a18-7d4fc6bd5fb6 {B3D34E0A-6726-45D0-82CA-038EDB146625}.rpt: Unable to connect: incorrect log on parameters.
Crystal Reports

Avatar of undefined
Last Comment
Computer101

8/22/2022 - Mon
Mike McCracken

How are you exporting the report?

mlmcc
ASKER
dwp_raj

I am exporting report in button click event the code is below
>>
 protected void btn_Exportrpt_Click(object sender, EventArgs e)
    {
   try
        {
            fpsReport report = new fpsReport();
            ExportOptions CrExportOptions;
            DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
            PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
            CrDiskFileDestinationOptions.DiskFileName = "c:\\crystalExport.pdf";
            CrExportOptions = report.ExportOptions;
            {
                CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
                CrExportOptions.FormatOptions = CrFormatTypeOptions;
            }
            report.Export();
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
}
Éric Moreau

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Mike McCracken

You need to pass the logon information to the report.  I believe emoreau's examples include that code.

mlmcc
ASKER
dwp_raj

Not Solved My problum Still it giving same error  Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\Rambabu\LOCALS~1\Temp\temp_9fdc4f14-b9f8-44ac-8a18-7d4fc6bd5fb6 {B3D34E0A-6726-45D0-82CA-038EDB146625}.rpt: Unable to connect: incorrect log on parameters.
Éric Moreau

You probably bound your report to a database when you first build it (instead of binding it to your .xsd which does not require any kind of connection).

see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2439984&SiteID=1
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
dwp_raj

I solved the problum
Mike McCracken

What is the resolution?

mlmcc
ASKER
dwp_raj

i maintained the state of dataset in export button click event
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Computer101

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question