I have tried multiple solutions in different posts to no avail, so please forgive me for being redundant. I have a dataset for an RDLC PDF report in ASP.NET using VS2010. I have changed the SQL statement to return two additonal columns to an existing set. I have stepped through the debugger and verified the two column are being returned with the proper data. However, I cannot get the Dataset to refresh with these new columns. And when I add them in the XML manually, the fields are just blank on the report.
Please help
Related
I have a report that displays a table of information inside a cell of another table. When the report is exported to excel there are blank rows above and below the table, the report looks fine when in HTML. I cannot have these as they throw errors when being imported into another application. How can I make it so that the table is one cell and no extra lines these?
Include that data in the outer list. If you are using Cognos as an ETL tool (something it is NOT good at) you'll want to flatten the output. Any formatting will cause you trouble downstream.
Excel format is probably not the best solution. You'll want to send your report to Excel Data or CSV.
I need to produce a Cognos Report that produces 12 tabs. Each tab contains the same sort of report simply run for a different parameter value, for example, the month of the current year. I would like to reuse the SQL and define it only once and have this SQL accept a parameter.
I'm very new to Cognos 10 Report Studio. Can I use the Event Manager to execute a single report once with 13 parameters but yet combine the results in a sdingle XLS with 12 tabs?
I know I can split the results of a single query across multuiple XLS tabs, but i need to run the same query multiple times with different parameters...
I've only seen a 5 min demo of Event Mgt, not sure if that's even the place. Any direction to a newbie would be appreciated.
Depends on how "different" the parameters are.
If you want to split the values of one data item across separate tabs, such as a tab for each month of the year, use Page Sets. Write one query, create one list/report object. Then Section the list and tie to the Page Set construct in the Page tab. Example
A report created in Report Studio with different Pages will also export to different Excel tabs. If you have to split on a combination of 2+ data items with different values, you'll have to use different pages and queries. You can't re-use one query and plug in different values for each page. So, copy the primary query object and re-write to use parameter(s) unique to each page. Your prompt page may get a little large, but this is the standard method to create a "book" of reports.
Event Manager is for triggering report execution based off changing data. The classic example is to send a "Thank You" note to a salesman when he logs a sale of $1m or more in the database.
In my project, I have lots of Crystal reports that were written long time ago based on database views. They used to work in a VB app where you can specify the sql statement dynamically in the codes by using the SQLQueryString property, the sql statement works as a filter.
Now that I am using crytal report 11 in ASP.NET 4.5, I cannot specify the sql statement any more, thus as soon as I call reportDocument.Load(...), all of the data from the view is loaded, which take minutes to load.
I know that I can add parameters to the reports to solve this problem, but there are so many reports to deal with, is there a way to filter the data without using the parameters? The bottomline is that I don't want to load all data when I call reportDocument.Load
Thanks!
You can set report's Record Selection formula
I'm using VS2010 and the built-in visual Report Designer to create RDLC templates for rendering reports with sub-reports as PDF files in an ASP.NET application using a ReportViewer control and the .LocalReport member. The code iterates over a set of records, producing one report (with its sub-reports) for each record.
I noticed recently that for a small number of the reports, one of the sub-reports was failing and giving the "Error: Subreport could not be shown" message. What's puzzling me about this case, in contrast to the many posts about this error that I've read (and previous times I've wrestled with it myself), is that it is only occurring for a subset of cases; from what I've seen elsewhere, the problem is usually all-or-nothing -- this error always appears until a solution is found, then this error never appears.
So... what could cause this error for only a subset of records? I can run the offending sub-report directly without errors; I can open the .xsd file and preview the DataSet for the offending records without errors; I can run the query behind the DataSet in SQL Server Mgt Studio without errors... I'm not sure where else to look for the cause(s) of this problem which only appears when I run the report-with-subreports?
I tracked this down to an out-of-date .xsd file (DataSet) -- somewhere along the way a table column string width was increased, but the DataSet was not updated or regenerated, so it still had the old width limit on that element, e.g., <xs:maxLength value="50" /> in the .xsd XML instead of the new width of 125 characters. The error was being thrown for those cases where at least one record in the subreport had a data value (string) in that column that exceeded the old width of 50.
An important clue came from adding a handler for the DataSet's .Selected event; I was already using the .Selecting event to set the sub-report's parameter (to tie it to the parent record), but I couldn't see anything useful when breaking in that event. However, examining the event args variable in the .Selected event, after the selection should have occurred, I found an Exception ("Exception has been thrown by the target of an invocation") with an InnerException ("Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints"). There was also a stack trace which indicated the point of failure was executing Adapter.Fill(dataTable).
While this turned out to be pretty misleading -- I had no such constraints in place on the tables involved in the query behind the DataSet -- it at least got me focusing on the specific records in the subreports. After much fruitless searching for anomalies in the subreport record data SQL Server Mgt Studio, I eventually started removing the records one-by-one from one of the offending subreport cases, re-running the report each time to see if I had fixed the error. Eventually I removed a subreport record and the report worked -- the remaining subreport records appeared!
Now I had a specific sub-report record to examine more closely. By chance (wish I could call it inspired intuition...), I decided to edit that record in the web app instead of looking at it as I had been in SQL Server. One of the fields was flagged with an alert saying the string value was too long! That was a mystery to me for a moment: if the string value was too long, how could it already be saved in the database?! I double-checked the column definition in the table, and found it was longer than what the web-app front-end was trying to enforce. I then realized that the column had been expanded without updating the app UI, and I suspected immediately that the .xsd file also had not been updated... Bingo!
There are probably a number of morals to this story, and it leaves me with a familiar and unwelcome feeling that I'm not doing some things as intelligently as I ought. One moral: always update (or better and usually simpler, just re-build) your .xsd DataSet files whenever you change a query or table that its based on... easier said than remembered, however. The queasy feeling I have is that there must be some way that I haven't figured out to avoid building brittle apps where a column width that's defined in the database is also separately coded into the UI and/or code-behind to provide user feedback and/or do data validation... suggestions on how to manage that more robustly are welcome!
Hi
I am fetching data from database and using parameters for crystal report, i post parameters from asp.net textboxes and receive in crystal report, it works fine and reports generates perfectly, but when i print it, only that record prints which is non db based, and dynamic records do not print, please help....
I got this problem solved by myself, posting an answer for the help of people who would use SAP Crystal Reports for Visual Studio 2010.
When you generate a crystal report from asp form, using parameters, the report is generated, and when you print, the page refreshes, which wastes the parameters of post, as it refreshes. So null parameters are passed to it, thats why database based rows will be empty, solution is use query string, or save the post variables in session and pick them on page load.
:)
Thanks