473,585 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic RDLC generation question

3 New Member
I'm a newbie to the messageboard, but I'm wondering if any of you gurus have tried to do the following before? I'm developing a custom reporting solution as part of a web application for a corporate client. One of the required features is a user-defined reporting (UDR) solution, but we cannot use ReportBuilder because their corporate firewalls prohibit ActiveX controls. Therefore, I have a wizard-style ASP.NET and C# interface that essentially allows them to go through and select the filtering parameters, fields, etc.

At the end of all that, I have generated the SQL string and I have to dynamically generate the RDLC code for this new UDR report. I have that part working and I have gone through by hand to verify that the code my rdlcGenerator is producing "appears" to be correct. (As an aside, I have opened the generated .rdlc files from within Visual Studio as well to confirm that they at least appear correct). I actually found a couple of examples on the net that helped me with the generation portion of the code. However, here's my problem:

Now that I have the new local report template that I generated, I've been unable to get it to run the actual report. I get the following error when I try to make the reportViewer display the report:
A data source instance has not been supplied for the data source 'DataSet1'.

I'll include a section of the RDLC file here to show the generic names I built into the report template:

<DataSources>
<DataSource Name="DataSourc e1">
<ConnectionProp erties>
<DataProvider>S QL</DataProvider>
<ConnectString> Server=.;Databa se=fms_comm;Use r ID=usr;password =pwd;</ConnectString>
<IntegratedSecu rity>true</IntegratedSecur ity>
</ConnectionPrope rties>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1" >
<Query>
<DataSourceName >DataSource1</DataSourceName>
<CommandType>Te xt</CommandType>
<CommandText>se lect name as 'Name' from view_DEALER_DIS PLAY</CommandText>
<Timeout>90</Timeout>
</Query>
<Fields>
<Field Name="Name">
<DataField>Name </DataField>
</Field>
</Fields>
</DataSet>
</DataSets>

And here is the c# code where I'm trying to add to add the datasource dynamically:

this.reportView er1.ProcessingM ode = ProcessingMode. Local;
this.reportView er1.LocalReport .ReportPath = _RDLfileName;
DataTable dt;
dt = DataAccess.getD ataTable(sqlTex t, null, false);
// the above line returns a valid dataTable that I have confirmed has records
TextReader re = File.OpenText(_ RDLfileName);

ReportDataSourc e rds = new ReportDataSourc e();
rds.Name = "DataSource1_Da taSet1";
rds.Value = dt;
this.reportView er1.LocalReport .DataSources.Ad d(rds);
this.reportView er1.LocalReport .LoadReportDefi nition(re);
this.reportView er1.LocalReport .Refresh();
re.Close();

If any of you guys can point out the error of my ways, I will GLADY acknowledge you as Guru Extraordinaire. :)
Jun 12 '07 #1
2 16726
dshipe
2 New Member
At the end of all that, I have generated the SQL string and I have to dynamically generate the RDLC code for this new UDR report."


Here is an alternate method for generating an RDLC....
http://csharpshooter.b logspot.com/2007/08/generate-rdlc-dynamically-for-vs-2005.html
Aug 7 '07 #2
dshipe
2 New Member
The easiest way to generate a simple RDLC from a dataset is transform the schema xml into the RDLC.

The basic idea is to build rather generic RLDC file off a DataSet. You can then bind both the DataSet and the RDLC to a ReportViewer control and get your report. I generate the RDLC by transforming the DataSet XML schema into a RDLC file via and XSLT transform.

Here is a website showing the C# code and the XSLT...

http://csharpshooter.b logspot.com/2007/08/revised-dynamic-rdlc-generation.html
Sep 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2044
by: duncan.lovett | last post by:
I am working on a graphical heading generator for a clients website as their server does not have the GD library or similar plugins for dynamic image generation. I have achieved the result partly, from a snipet I found in the user contributions to the "str_replace" function in the manual on php.net. However there is a small problem - it...
11
4715
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to create content to put at the address pointed to by f. In particular, I'd like to avoid/replace the memcpy line. Possible application (inspired by Paul...
4
23301
by: DraguVaso | last post by:
Hi, For my VB.NET application I have the following situation: 2 tables on my SQL Server: tblAccounts and tblRules. For each Account there are many Rules (so tblRules is linked to my tblAccounts by the Account). In the tblAccounts thee is a field Company which occurs many times (there is more than one Account for each Company:). Whet I...
2
3285
by: Irfan | last post by:
hi, I am getting the following error. Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information when i try to use da.update I squeezed my program to just few lines to know the reason for this error. Atlast, i found that if i am using the stored procedures to get the data, then this
0
5797
by: Gancy | last post by:
Hi, I have data access tier designed in such a way, just by changnging application settings, same lines of code is made to work with both MS SQL Server or MS Access. Code works fine with MS SQL Server. however while executing following code lines on MS Acess ds = new DataSet(); oAdapter.SelectCommand.CommandText = this.SelectCommand;...
15
2053
by: Nospam | last post by:
Is there a tutorial on dynamic SID generation?
2
3075
by: Ghada Al-Mashaqbeh via DotNetMonster.com | last post by:
Hi all, I am facing a problem in dynamic code generation at run time, the problem occurs when the dynmaic code use global data exist within the original application. Lets say that my application is called "Dynamic Code", so the name space in my project is "Dynamic Code", I have created "Form1.cs" where my code exist. Form1 class contain a...
5
20146
by: =?Utf-8?B?QUEyZTcyRQ==?= | last post by:
The full error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." I am getting this error when updating a table bound to a datagridview (using the OLEDataAdapter) when the table does not have a primary key; my code works when the table does have...
0
1354
by: pieandpeas | last post by:
Hi, I'm having a problem with my code, I am doing the following - retrieving a field from a table, which is linked to another table, i'm only updating one of the fields in one of the two tables... ############## Page Load Sub sqlselect = "Select ProductID,Name,Price from Products,Store Where Products.StoreID = Store.StoreID And StoreID...
0
7908
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8212
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.