.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using the single *.rpt file with multiple data sources

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I've created a set of CrystalReports (*.rpt files) for an ASP.NET web app on a development server. I call each report using the following code:

protected void BTN_RunReport_Click(object sender, ImageClickEventArgs e)
CrystalReportViewer_ClientLetter.Visible = true;

ConnectionInfo con = new ConnectionInfo();
con.ServerName = Constants.ServerIP;
con.DatabaseName = Constants.DatabaseName;
con.UserID = Constants.UserID;
con.Password = Constants.Password;

CrystalReportViewer_ClientLetter.ReportSource = Server.MapPath(Constants.ClientLetters);
ParameterFields parameter = CrystalReportViewer_ClientLetter.ParameterFieldInfo;
ParameterField batchdate = new ParameterField();
batchdate.Name = "@BatchDate";
ParameterDiscreteValue batchdate_value = new ParameterDiscreteValue();
batchdate_value.Value = Convert.ToDateTime(txtBatchDate.Text);

foreach (TableLogOnInfo tlf in CrystalReportViewer_ClientLetter.LogOnInfo)
tlf.ConnectionInfo = con;

View Complete Post

More Related Resource Links

SSIS multiple data flows accessing the same raw file

I have multiple data flow tasks accessing the same raw file at virtually the same time.  I would like to know if the data flow tasks lock the raw file during read?  Can multiple data flow tasks read the same raw file at the same time.  I'm currently developing with a very small data set, but I would like to know if I should be concerned with the possibility of the data flow tasks competing for access to the same raw file. Thanks.

What are my options when I need to create a report with data from multiple sources?

Hello all,  What are my options when I want to create a report that will get records from multiple data sources based on data from a parameter? The user will enter the customer ID, I have to check that ID against 5 different data sources. Have you guys done anything similar? Should I leverage SSIS on this request, adding an extra layer of complexity? Should I do this all from SSRS? What are my options?


the database result is as follows DATE     code   class1 class2  class3 1/8/10     M1     10       20     30     3/8/10     V2      20       30     10      1/8/10      H1      1           2      3         7/8/10     ! ! 8/8/10     !M2    5      5      5       3/8/10     B2      4      4     4       1/8/10     V1      3      7     3       THE OUTPUT SHOULD BE AS FOLLOWS:- DATE           M1                          M2           

Multiple sources for XSL transformations to generate single XML output

I have a situation where i need to call multiple web service methods and get their responses in XML format. Then I need to combine all those responses in one single XML message which would be returned from my custom web service method, someting like this: {Message1 + Message2 + Message3} -> XSL -> CompositMessage (output) Is it possible to achieve this using XSLT, it could be "XslCompiledTransform" or any other alternative? Farrukh

how to display multiple calendar list data in single calendar view

Hi, Normally, we can used to extend the ListViewWebPart's ViewType property to display a particular calendar list items in Calendar View in our custom webpart. Is it any way to display multiple calendar list data in a single calendar view ?? or please provide some pointers related to this issue. Any help is much appreciated.    

Creating a report from multiple data sources

I am working on a report where it requires pulling data from various sources, databases and data exported into excel sheets from different databases. The objective of the report is to create a single report with all the Providers (HPs) that have been terminated. So what I have done is that I have exported all the data on a local server in the pubs database and I am using a TSQL query to return the report. The same providers may exists in the various data sources so I have to make sure that I am only returning the data once...how ever the challenge is that, other than FirstName and LastName, there are no consistent IDs that we can use in all. For example, not all of the records have the SSN, PhoneNumber, or other IDs that uniquly identify the record. I have to create a report that returns the result set and identifiys the matching records and the source system the data is from..for example the output should display as such: Termed System firstname lastname SSN homephone phonenumber Active System AMIE Jeannine Donigan NULL 3522631007 Nurse SL Linde Peggy Vanrensselaer NULL 6077321218 Sbdev Below is the approach I I have taken to return the data and I wanted to know if there is a more efficient and better way of doing this: DECLARE @matchingTerminated Table ( FirstName Varchar(255), LastName Varchar(255), Gender Varchar(255), SSNEncrypted varchar(255), Birt

Does Microsoft plan to enhance SSRS to allow access to multiple data sources?

We have the need to join multiple data sources into one table in SSRS.  At present, as I understand it, this is not a part of current delivered functionality.  We get around it by creating links withing the source database to access other databases.  The links themselves have their own set of constraints and performance issues. The other option is to use sub reports.  It would be nice to be able to define connections to disparate databases to join data from multiple data sources.  Does Microsoft have plans to deliver such functionality in an upcoming release of the SSRS product?

Insert/Update data to multiple tables on a single button click


Hi experts,

I need to insert/update data to 3 or more tables on a single button click.What is best method for achieving this?I am using mysql as my DB.

Thanks for your valuable reply in advance.

Single Row (Flat File) to Multiple DataSets


I have a flat file with 320k rows.  Each row contains generic data such as a supplier number, plant name, and dock code.  Each row also contains 5 sets of 4 fields route name, region code, arrival date and departure date.  Each of the 4 fields begin SX_ where the X is the set number.  So for example the column names per row are:


What I need to do, using the flat file as a source, is to read the generic fields into one dataset and the SX fields into another.  I then need to copy these datasets to an OLE DB destination into their respective tables.  This is very easy using a Windows Service and VB.NET.  Anyone have any ideas how to accomplish this using SSIS 2008?

a single row of data with commas -> INTO -> multiple tuples?


I have the following select statement:


SELECT the_items from ItemTable


result: item1,item2,item3,item4,item5


I want to place those items into a NEW item table(uniqueidentifier ID, varchar(20) TheItem):


123456 ||  item1

987655 ||  item2

765498 || item3



Anybody have a nice easy query to do that????



Multiple result set to a single text file




I have a stored proc which gives me 5 resultsets.

I want to store these  in a flat file.

all the result set columns are different.

How can i store all these results into a single file in SSIS.??


sample resultset columns::

date  name

date  name   id    value

date  name   id    percentage

date  name  id     totalvalue

date  name  duration




Cube creation from multiple data sources



I have to design a cube that is using multiple data sources to fetch the data.

Is there a way, to connect to 2 data souces and create the data source view (.dsv) ?

Please suggest!!


Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

convert SQL data to EDI 835 file


I was assigned to create a app to convert SQL data to EDI 835 file. (Electronic Data Interchange file for Health Care Claim Payment/Advice,  outbound process only).

Can someone help me where to start?

data from multiple row



I have a dataset in my SSRS report where I am getting the data like this. It has 3 rows.

ID Parameter Value

1. Client Name-  XYZ

2. Client Email - xyz@s.com

3. Clinet Phone- 234567

I need to check condition in expression, so If parameter is Client name then It will show in client name textbox of Report. How can write expression for this.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend