473,322 Members | 1,307 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,322 software developers and data experts.

Operation Illegal on Linked Parameters C# and .Net

26
Hello. Good day. I have this problem with my current program right now. I have a separate report created in Seagate Crystal Reports, and I'm integrating it to my program in C#.

I'm using CrystalDecisions and calls the ReportDocument class.

Under that report, I have many subreports. What I want to do is to select ALL the fields in the MAIN report and put it in the DataTable, then I would put that DataTable as the DataSource of my ReportDocument.The problem is, when I set a value to any of my subreport parameters, I am getting an error "Operation Illegal on Linked Parameters".. Any help? Thanks!
Mar 1 '10 #1
1 3737
kurtzky
26
ok this is my code snippet, just to elaborate my problem above, which is the Operation Illegal on Linked Parameter. I use this logic in order to load my report faster:


================================================== ====

DataTable dtQuery = new DataTable();
ReportDocument rdt = new ReportDocument();
rdt.Load(@"C:\Reports\Items.rpt");

string sql = "SELECT order_no, supplier_no, item_no, qty FROM Items WHERE order_no IN IN ('" + ord_no + "') "; //ord_no is a string, contains the order numbers to be printed, example is ord_no = (''1234', '3432', '2346');
dtQuery = Database.GetDataTable("Server1", sql); //GetDataTable is a function under Database class, Server1 sample name only
rdt.SetDataSource(dtQuery);
rdt.SetParameterValue("OrderNo", arr); //arr is an array, so it's possible to have many OrderNo to be printed in the report; this is the Main report's parameter

ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
DataDefinition DataDef = rdt.DataDefinition;
ParameterFieldDefinitions pm = DataDef.ParameterFields;
ParameterFieldDefinition Param1; //Param1 & Param2 are my subreport parameters
ParameterFieldDefinition Param2;
for (int i = 0; i < dtQuery.Rows.Count; i++)
{
Param1 = pm["Pm-supplier_no", "Supplier"]; //Supplier is a subreport
paramDiscreteValue.Value = dtQuery.Rows[i]["supplier_no"].ToString();
Param1.CurrentValues.Add(paramDiscreteValue);
Param1.ApplyCurrentValues(Param1.CurrentValues);

Param2 = pm["Pm-item_no", "ItemDesc"]; //ItemDesc is another subreport which takes item_no as the parameter
paramDiscreteValue.Value = dtQuery.Rows[i]["item_no"].ToString();
Param2.CurrentValues.Add(paramDiscreteValue);
Param2.ApplyCurrentValues(Param2.CurrentValues);
}

================================================== ====

Notes:
- In my Supplier subreport, I have a parameter called Pm-supplier_no. This is the link to the MAIN report's supplier_no field. This subreport will display all the supplier details. In this subreport's Record Selection, I have SupplierTable.supplier_no = {?Pm-supplier_no}

- In my ItemDesc subreport, I have also a parameter called Pm-item_no. This is another link to the MAIN report's item_no. This subrepot will display all the item details. The reason why I have a for loop is that it's possible to have many items in the main report, so I have to pass also the exact number of items to its subreport. In this subreport's Record Selection, I have ItemTable.item_no = {?Pm-item_no}.


Thanks a lot! Any help will be appreciated!
Mar 1 '10 #2

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

Similar topics

2
by: rob | last post by:
Dear All, I am getting an error "Illegal cross-thread operation". I am not creating any threads. I know internally there are many threads running, though. Does that mean that no form can call a...
15
by: brettclare | last post by:
I have linked a large SQL Server table to Access, however 'only' 2,195,439 records are shown and are available to query. Can I increase the size (cache??)/number of records showing in Access? ...
12
by: [Yosi] | last post by:
What I should do to return back the permissin I had in VS2003 , that allowd me to access public methode of one Class from other Thread. I have Class A(FORM) which create new thread (new class B),...
4
by: oran johnson | last post by:
Illegal cross-thread operation: Control 'PopupInfo' accessed from a thread other than the thread it was created on. Can I track this down using the debugger? Thanks.
10
by: CJM | last post by:
I'm trying to call a package/procedure in oracle (from an ASP page) which requires a number of parameters. I have got this working using OO40 but unfortunately the transaction rollback function...
2
by: vvenk | last post by:
Hello: I wrote a small program to insert a row into an Oracle Table: CREATE TABLE case_list (case_list_name_c VARCHAR2(100) NOT NULL, expiry_dt DATE NOT...
0
by: Jacn | last post by:
Hi! I have a several problem with the oracle connection and ADO, I use a executenonquery for a select sentence and I use two output parameters and two input parameters, when I run the application an...
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
2
by: HotFrost | last post by:
Hello everyone, i am trying to work with linked servers... The local server is the one used by UPS worldwide software (it is Microsoft SQL Server Desktop Engine, v 8.00.2050). The linked server...
0
by: Default User | last post by:
I work on creating test cases for a SOAP-based set of servers, using soapUI. I received and updated set of WSDL and schema files, and when I made new tests and mock server operations, all of the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.