set logon info for subreport

Posted on 2004-11-04
Last Modified: 2008-02-01
hi all,

I am using CR 8.5 and ASP .net 2002 (C#), my subreport requires login to a file dsn which need a username and password,
I am using asp .net 2002 as the front end, how can I set these login information in the code? here is the code I have right now, (from another nice expert here), however, it doesn't work for me, please help: in here, I don't know where can I set the file dsn, say for example the file is "C:\dsn1.dsn", what can I do? Thanks a lot!!!!

// Create report instance                  
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load("C:\\Projects\\Accpac\\Product Billing\\merge_prompt_for_custID.rpt");  // location of report

reportDocument.SetDatabaseLogon("sa", "now2k1"); // username and password for DB access

// Assign parameters to report      
reportDocument.SetParameterValue("CUSTOMER_ID", "1000003");
reportDocument.SetParameterValue("Months", "2004-05");
reportDocument.SetParameterValue("RUNDATE", DateTime.Now.ToShortDateString());
// Print
reportDocument.PrintOptions.PrinterName = "Adobe PDF";
reportDocument.PrintToPrinter(1, false, 0, 0);

// Export - This will require export options to be defined.
Question by:ultrafish
    1 Comment
    LVL 100

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now