set logon info for subreport

Posted on 2004-11-04
Medium Priority
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 101

Accepted Solution

mlmcc earned 1000 total points
ID: 12504809

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

809 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