473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Crystal Report & Application variable

[sorry if this is the second one you receive]

Hi all,

My web application has Application variables for
connection strings, as they can change often.

Global.asax.cs :

protected void Application_Start(Object sender, EventArgs
e)
{
Application["Server"]=...;
Application["DataBase"]=...;
Application["UserID"]=...;
Application["Password"]=...;
}

I'm discovering Crystal Reports, and try to use these
variables. First docs I read talk about defining a dataset
(xsd format), but this doesn't allow me to use my
Application variables. I read an example who seems to
match my needs, here is the code :

ReportDocument rd = new ReportDocument();
rd.Load (@"myReport.rpt");
int i;
for (i=0; i<=rd.Database.Tables.Count-1; i++)
{
TableLogOnInfo tloi = new TableLogOnInfo ();
tloi.ConnectionInfo.ServerName = Application
["Server"].ToString ();
tloi.ConnectionInfo.DatabaseName = Application
["DataBase"].ToString ();
tloi.ConnectionInfo.UserID = Application
["UserID"].ToString ();
tloi.ConnectionInfo.Password = Application
["Password"].ToString ();
rd.Database.Tables[i].ApplyLogOnInfo (tloi);
}
rd.ExportToDisk (ExportFormatType.PortableDocFormat,
@"myReport.pdf");

This works perfectly fine with an empty report, but
what can I do to get the database's fields on the report,
as I don't have any .xsd file ?

Thanks
Karine

Jul 21 '05 #1
0 1416

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
0
by: Karine Edhel Proot | last post by:
Hi all, My web application has Application variables for connection strings, as they can change often. Global.asax.cs : protected void Application_Start(Object sender, EventArgs e) {...
1
by: Bari Allen | last post by:
First I'm an almost complete newbie at .NET, as I've only taken some classes, worked through a beginner-level book, and done one minor console application on my own. That being said, I followed...
0
by: Henry | last post by:
Using ideas provided by some of you I was able to figure out how to get the names of the parameters fields of a crystal report specified at run time. The code below just basically puts the...
0
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application...
0
by: John Kastrinos | last post by:
Yes, I know this is more of a Crystal group question. I posted there about 2 weeks ago, but no one EVER replies over there. So, I thought I would take a shot here. If anyone has heard of this,...
1
by: riyaz | last post by:
i am new to .net environment, anyone can advise me how to create a crystal report ,how to connect to databse and to display in web page .As i m developing asp.net based web application i want...
1
by: pmkconsulting | last post by:
Hello, I am using an asp script that uses rptserver.asp to display some reports over http. It worked fine previously but now the webpages with the report display just hang. I tried switching from...
0
by: Mark Gold | last post by:
Hi! We have a VB application using Crystal Reports 6 that has worked successfully on hundreds of systems for over 10 years. Now, on one network, the application and access database does not close....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.