I have an XtraReport with 6 charts containing 4-8 LineSeries, where each Series can have up to 25,000 Points. The data comes from a query from a database table.
The problem is, that it takes around 3 minutes to draw the report which is too long for us.
So we need to reduce the number of points (which I already did in another case, so I know how to do that).
But where is the "right place" to perform this reducing action? Within the screen where the ReportPreview control is located and passing a new Collection (with all the series) as Parameter to the report? Is it possible to use such an custom Object as Parameter?
Or should I first load the database table inside the report and then reduce it?
How can I access the Datasource within the XtraReport by code?
And how can I tell my chart components to select my Collection as dataSource and not the database query result?
Also any other ways to improve the performance of XtraReports & charts.
Thanks.
EDIT
We created a SQL View which reduced the number of points and also used some code in the Preprocess_query methode with LINQ to use only needed points.
Related
Problem:
You have a regular repeating table when it comes to the rows but need the columns to repeat as well based on the difference between two fields.
Ex. The difference field has the value 4 so the table needs to have 4 columns (The number of rows is already variable because of the repeating table control).
The problem also lies in the fact that there is no maximum difference, it can be any value, so creating all the columns and adding formatting rules to hide them isn't a feasible solution.
Is there any way that using C# we can create a new field or table, or access a previously created table in the Infopath form?
https://docs.google.com/spreadsheets/d/1nj5xOuveD-CHTSJkgJOm_qnxKf5KTBr4OTdSJMMUKKw/edit?usp=sharing
The link above is an excel sheet with a small demonstration of the expected output.
Thanks.
I am new to WPF. I am making an windows app which will scan a QR-code, divide its contents into multiple parts and display them under several columns as below.
e.g. (in the picture attached)
example
When a QR-code is scanned repeatedly, the Qty field is increased by 1 each time.
Can any one help me how to achieve this in my application.
(I have used datagridviews and dynamic labels in winforms, but in WPF the best recommended way?)
First of all, how does the data arrive from your scanner? Is it an array? Or a List?
If it's an array you can easily add a new column to the grid which receives an increment value (f.e. "x++") every repeat of a foreach loop. If you upload a few code snippets I will try to tinker something.
I am with a little issue on handling with one of my applications.
I have a Vessel's historic which is shown on a ListView, but until now I have never needed to show all the data inside this history (the user was using kind of a filter to get what he needed), but now one of the managers want to see all data through the application (they was receiving the full data through an excel report).
The biggest issue is because its 6000 rows with 21 columns each one and when I try to select all the data it takes something between 5 minutes to fully load, but more than that the user need to add new, edit or copy the history, which brings him to a new update on the list with more 5 minutes to load.
I don't quite know how is the best way to handle with this and I wanted your help!
I would actually split the information into sections. Rather than loading 6,000 rows plus columns all at once, why don't you use something like alphabetize the information? Use a different ListView for A-G, then another ListView for H-O, then so on and so forth. That why it would cut down the time it took to query all of the information.
I had an interview Question .
Q. how to improve performance of a Gridview contains 100000 Records of data(Datasource might be XML or DB) in c# asp.net ?
I was just blinking as i had no answer for this .Please Give me the solution for this. If possible please give one demo.
No gridview should contain 100000 records.
Your data source may contain 10 times that number of records, it doesn't matter. If you present a user more than 100 records on screen, it would be difficult to work with that data.
Select a datasource that supports paging for the gridview, that way you are only working with the number of records to be displayed on screen.
For a database you can use something like SqlDataSource.
The default XmlDataSource does not support paging, in such cases the grid will have all records in memory and handle paging itself. For xml with large number of records consider using an ObjectDataSource, where you can implement paging yourself.
If you have a choice, always select a data source that supports paging.
To fix such a GridView, I think a good approach would be to:
Add paging (as others have already pointed out)
Add filtering/searching
Add a cap/limit for maximum number of rows shown
The filtering + max limit for results is (in my opinion) a good way to keep the size of the grid manageable. If the max limit is hit using some specified set of filters (=search terms) you could show a message about it to the user and encourage him/her to specify a more specific search if necessary.
As stated before, a gridview should not hold so many rows.
In your interview, they wanted to see if you can say that its bad implemented rather then to check your programming skill.
But if one insist for good performance, I would suggest to use Repeater instead of Gridview.
Cheers,
Ran
The simplest example that I can provide for what I want to do is this:
I need to create a Report, whose only requirement is that I have (4) of the same subreport on the page (imagine 4 portrait-oriented post cards on a page), each quadrant using a separate row from my datatable, yet all 4 are identical in terms of fields. If there are more than 4, it needs to carry over to a new page with the same format.
I'm using C# and the built-in Crystal Reports Basic for the task.
Couple of suggestions:
What about structuring your subreport to have two entries side by side, bind two rows to that subreprt, and handle formatting such that the last one on the right side is blanked should you have an odd number of rows?
Or there may be a way to specify your page size to be 1/4 of the full page size (4.25 x 6.5 inches) and then fit four reports on one page.