Crystal Reports XI with Oracle Function wm_concat() - crystal-reports

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.

Related

Crystal Report showing empty when DB query returns data

Not sure what's going on here. I'm creating a report using two tables. I do an inner join on both tables to obtain the rows I need. I'm sure the proper rows exist because I have taken the DB query that Crystal Reports generates for you and ran it on sql developer and it returns the appropriate rows. Not sure why my report would return empty if it's grabbing the proper rows and the DB has been verified using Crystal Report's "Verify Database" tool.
Check and Double check each section of your report, you might have left some Suppression formula. Secondly check and double check Record Selection filters in the report.
Sometimes what we don't see the first time, miraculously appears the second time.

Crystal Reports: Add a parameter to query

I'm using the Crystal Reports add-on to Visual Studio. The report calls a stored procedure with a whole list of parameters. I added an int parameter to the stored procedure, now I want to make the crystal report pass a 1 for that parameter.
How do I do that? When I go to database expert > Selected Tables - it just shows the name of the stored procedure. Where does it list the parameters?
If you already created the report and added the parameter to the stored procedure after that you need to use "Verify Database" to get the parameter to the report

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.

Create Report using Crystal Report XI from DataSet

*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.

Crystal Reports - Stored Procedure Syntax Question

When I drag a field from my stored procedure onto a formula (Crystal Reports 11), I get something like this:
{sp_YES_AccountSnapshot;1.ST0405_Ext}
What does the "1." represent?
I hope it refers to the table number... because I'd like to return two tables from the stored procedure and be able to access both from a report.
Thanks
I believe the semicolon one (";1") represents if the sp is active or not in the database.
I opened a report and connected to a datasource I frequently use and all of the sp's have ";1" except for 2 sp's which have ";0". Those sp's are old sp's which were deleted and do not show in the SQL Server Management Studio.
I don't believe that multiple tables can be pulled into a Crystal Report from an sp. When I just tried it on my system Crystal Reports closed out.