Create Report using Crystal Report XI from DataSet - crystal-reports

*STEP 1.*My program get Crystal Report (XI sp6) templates from admin. It parses the templates to get SQLs from that and then populate it to get DataTables for each SQL.
*STEP 2.*After that, it push the DataTables back into the ReportDocument to create the report by using the following code:
// there no subreport in our template
//mainDS include all populated DataTable having the same name of related CR Command Alias
foreach (Table tab in doc.Database.Tables)
tab.SetDataSource(mainDS.Tables[tab.Name]);
The problem is (I wonder if it is a Crystal Report Bug): if there is 2 Command in the template, when the code tab.SetDataSource(mainDS.Tables[tab.Name]); is executed for doc.Database.Tables[0] then doc.Database.Tables[1].Fields is become the same to doc.Database.Tables[0].Fields and ofcause I get an error.
I do not get this error with all templates, just some :(. All templates worked well in Crystal Report GUI!!!
Please help if it not bug or please show me how to work around!
I am using Crystal Report XI Developer Edition with latest pack, VS2005. Oracle 10g, Devart DotConnect for Oracle Free version.

After mining SAP document and test many times, I think that it is a bug of CR XI R2 sp6. So I on report I only keep 1 Command, If there is a need for other commands, I will create subreports and put the commands in these.

Related

Crystal Report dynamic parameter values do not show up in prompt when report is opened within SAP B1

Crystal Report dynamic parameter values do not show up in prompt when report is opened within SAP B1. However, it is working fine when the report is opened in Crystal Report Designer. Please help thanks!
You need to run the report and initiate the parameter from inside Crystal Reports when on B1.
The list you see from outside only shows if you're using a parameter query like #SELECT, etc ...

Converting Crystal Reports to DevExpress reports

I'm currently converting all of the Crystal Reports we have at work to DevExpress Reports. However, I haven't been able to find the DevExpress equivalent of CrystalDecisions.CrystalReports.Engine.Section. What would the correct class be? I am using DevExpress v 16.2
You actually have something similar in xtraReports, named Report Bands as you can see in the image below

Replacing Crystal Report data source with store procedure

I used to create crystal reports by going into database expert, selecting tables and specifying the link manually. As I get a bit more comfortable with CR, there is a need for me to put the underlying SQL query into a store procedure to provide data to the report. But doing so will require me to rewrite the whole report which is time consuming.
So, my question is if there are any guru in the community that could and/or have tried to replace the underlying SQL (created by manually add table and links) with a store procedure or cmd without having to rewrite the whole report? I would love to get some hint of how to do that as I have a couple dozen of reports that need "adjustments" and time does not permit me to rewrite them all.
My Crystal Report versions are CR 2008 and CR 2012.
Thank you in advance.
In case you can use an existing software : this feature is available in a free Crystal reports viewer. Here is the documentation, which explains the use :
http://www.r-tag.com/Documents/RTag%20DataSource.pdf
... and here is where you can get your free license:
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx
Crystal does an absolutely horrible job of migrating from many tables to a single DB object, be it a Command or stored procedure.
You might be able to Database | Set datasource location... to map your SP to one of the many tables in the report (choose the one that has the most fields in use); I've never been able to get this feature to work trying to map a Command to a table.
'Best practice' for a really-poor 'feature' set:
create a formula field for each field that will be on the canvas, but isn't grouped (these fields won't be removed when you change datasources)
add the Command to the report; link tables if desired
manually switch grouping, record-selection formula, sorting, etc.

Openerp using subreport by Jasper Report

I want to create a sale order report with Jasper Report. So, I took xml of sale_order object by Jasper's data template of openerp and I set depth 3 in that xml file. And then, I created report by using Jasper Report. After that, I added this report by using new Jasper Report of openerp. My report has a dataset in the main report for sale_order_lines. So that, I have an error below:
openerp.netsvc: Report Error Failed to invoke method execute in class com.nantic.jasperreports.JasperServer: Error evaluating expression : Source text : $P{REPORT_DATA_SOURCE}.subDataSource("//sub_report")
How to fix this error? If you don't mind, please explain me step by step.

Crystal Reports XI with Oracle Function wm_concat()

Within Crystal Reports XI I'm trying to have a SQL Expression Field with Oracle 10g function wm_concat(column_name). It appears that Crystal Reports XI is not handling this function properly. If I execute the function wm_concat() within the database, it works fine, however, when trying to use it in Crystal Reports it displays a blank page. Whats interesting is that this field is within a sub-report, yet the whole report displays as a blank page.
Crystal Reports can tell at design-time that this function is valid (It doesn't let you save the SQL Expression if its not valid). So its a runtime error. I have also tested using various Oracle functions such as TO_CHAR() and REPLACE() and these all work fine with Crystal Report SQL Expressions. Any ideas?
WM_CONCAT isn't a built-in function, and isn't necessarily installed with a database.
You could try WMSYS.WM_CONCAT, as the function is actually owned by the WMSYS schema.
You may need to add a specific grant. By default, if it is there, it has EXECUTE granted to PUBLIC but your DBA may have revoked that and replaced it with specific grants.
I couldn't get WM_CONCAT to work; Since the queries execute flawless in Oracle, but not in Crystal Reports I would assume it is something within Crystal Reports. I ended up having to make a PL/SQL Stored Procedure and call it from the Crystal Report. I called the Stored Procedure from a SQL Expression Field within Crystal Reports.