473,386 Members | 1,647 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,386 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 1414

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.