Page 1 of 2

Parallel Arrays

Posted: Fri Aug 05, 2011 1:08 pm
by djm000111
I am creating a report that uses parallel arrays, or a single multidimensional array in the code behind. Does anyone know where I can get a code sample? I've got it started and have one array working, but a sample would help.

Parallel Arrays

Posted: Mon Aug 08, 2011 3:09 am
by HighAley
Hello.

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Maybe you can send us a sample project with arrays and a report template. And, please, describe what you try to achieve.

Thank you.

Parallel Arrays

Posted: Tue Aug 09, 2011 12:44 am
by djm000111
I've sent you a project containing the report. In the comments of the "QtyPerItemNumbers" function, in the code tab of the report, I've listed the things I would like to accomplish with this report. I've also listed the values that would be displayed in the report if it was working correctly.

Thank you very much for your help!

Parallel Arrays

Posted: Tue Aug 09, 2011 7:00 am
by HighAley
Hello.
djm000111 wrote:I've sent you a project containing the report. In the comments of the "QtyPerItemNumbers" function, in the code tab of the report, I've listed the things I would like to accomplish with this report. I've also listed the values that would be displayed in the report if it was working correctly.

Thank you very much for your help!
First of all you can simplify your report template by minimizing of GroupBands. You can use one GroupBand instead of four using next expression

Code: Select all

{SubParts.Thickness}{SubParts.Material}{SubParts.Cut_Length}{SubParts.Cut_Width}
Next, I've
- added new sting variable {Variable1}
- changed expression of the GroupHeader6 to {SubParts.ProductsIndex}
- wrote BeforePrint event in GroupHeader6

Code: Select all

Me.Variable1 = Me.Variable1 + " #" + SubParts.Subassembly.Products.ItemNumber + "(" + (Totals.Sum(GroupHeader6, SubParts.Qty)*SubParts.Subassembly.Products.Qty).tostring + ")"
- wrote BeforePrint event in GroupHeader5

Code: Select all

Me.Variable1 = ""
(you can write it in other Band event)

Now, in generated report you can see red string. I guess it is what you want. Therefore now you don't need "QtyPerItemNumbers" function.

Thank you.

Parallel Arrays

Posted: Wed Aug 10, 2011 7:01 pm
by djm000111
Thank you for the solution. I'm having trouble viewing it. I downloaded your edited project, but when I opened it in Visual Studio 2010, I got reference errors. I updated the references, but it still won't compile due to errors.

There are two errors remaining:
1.) The designer cannot process the code at line 25: Me.StiReport_Test1 = New Stimulsoft.Report.StiReport()

2.) 'DataBandsUsedInPageTotals' is not a member of 'Stimulsoft.Report.StiReport'. C:\Users\...\My VB.Net Projects\Test Array Report 3-5\Test Array Report 3-5\Form1.Designer.vb 33 9 Test Array Report 3-5

Can you tell me if you added functionality that would require other configuration changes on my end? Can you think of any reason for the errors?

Also, why am I not able to see the Stimulsoft references in the "Add Reference" box, under the .NET tab? I had to add them manually and from previous experience learned that doing so limits the project somewhat. Any ideas? I have uninstalled Stimulsoft, cleared all Stimulsoft DLLs from the GAC, and reinstalled.

Thanks for you help so far.

Parallel Arrays

Posted: Thu Aug 11, 2011 3:25 am
by Ivan
Hello,
djm000111 wrote:2.) 'DataBandsUsedInPageTotals' is not a member of 'Stimulsoft.Report.StiReport'. C:\Users\...\My VB.Net Projects\Test Array Report 3-5\Test Array Report 3-5\Form1.Designer.vb 33 9 Test Array Report 3-5
Can you tell me if you added functionality that would require other configuration changes on my end? Can you think of any reason for the errors?
The "DataBandsUsedInPageTotals" object is used in the latest builds of our product.
For your version (2010.1.700) please simply delete this line of code.

Thank you.

Parallel Arrays

Posted: Thu Aug 11, 2011 5:05 am
by HighAley
Hello.

Sorry, i attached the wrong project. Please check this project.

Thank you

Parallel Arrays

Posted: Thu Aug 11, 2011 6:05 am
by HighAley
Hello.
djm000111 wrote:Also, why am I not able to see the Stimulsoft references in the "Add Reference" box, under the .NET tab? I had to add them manually and from previous experience learned that doing so limits the project somewhat. Any ideas? I have uninstalled Stimulsoft, cleared all Stimulsoft DLLs from the GAC, and reinstalled.
If there are any problems you can add assemblies from browse tab.

Thank you.

Parallel Arrays

Posted: Thu Aug 11, 2011 10:01 am
by djm000111
Thank you for your comments, but I still have a problem. I downloaded the second project and get the following error when I try to run it: "OleDb Exception was unhandled." Alternatively when I try to preview the report from the Report Designer I get an error: "Object reference not set to an instance of an object" and nothing is displayed.

Also, is there important functionality that is used in the "DataBandsUsedInPageTotals" object that is used in your solution to my problem, or is there a work-around to using that object so that I can accomplish the same thing in the report without using it?

Thank you,

Parallel Arrays

Posted: Fri Aug 12, 2011 1:56 am
by HighAley
Hello.
djm000111 wrote:Thank you for your comments, but I still have a problem. I downloaded the second project and get the following error when I try to run it: "OleDb Exception was unhandled." Alternatively when I try to preview the report from the Report Designer I get an error: "Object reference not set to an instance of an object" and nothing is displayed.
Please correct the path to the database by editing OleDb connection.
djm000111 wrote:Also, is there important functionality that is used in the "DataBandsUsedInPageTotals" object that is used in your solution to my problem, or is there a work-around to using that object so that I can accomplish the same thing in the report without using it?
Please comment this string

Code: Select all

Me.StiReport_Test1.DataBandsUsedInPageTotals = Nothing
in Form1.Designer.vb.

Thank you.