Duplicate dataset etc. error in rdlc report - visual-studio-2005

I keep getting an unhelpful error while trying to create a subreport using Visual Studio 2005. The error is:
More than one data set, data region, or grouping in the report has the name ‘Factor_StoreTrak_StoreTrakEntities_POS_PollingResultsDetailDTO’. Data set, data region, and grouping names must be unique within a report. C:\Development\WindowsApps\ReportTesting\Reports\PollingResultsSubreport.rdlc
Now, I keep having the report partially done and compiling and running just fine but when I add a new column or somehow change it I suddenly get this error. I then delete every control off my report one by one trying to recompile after each deletion and this error is always thrown. I delete the report and start from scratch only to have it happen again at some random point.

If you need to change the report after the referenced assembly is recompiled / versioned, just open the rdlc file (report file) with Notepad.exe (see that is just an XML file), find the DataSets section and simply delete the older data set, save the changes and reopen the report in the IDE.
If the new dataset is not yet in the file, simply drag a field from the datasources panel onto your report somewhere, this will create a new dataset in the report.

In my case the problem was that when I inserted a row group, it gave it the name "matrix1_RowGroup4", even though there already was a "matrix1_RowGroup4" in the report. It this complained, "More than one data set, data region, or grouping in the report has the name 'matrix1_RowGroup4'."
What I did to solve it was:
Opened the XML file ([myreportname].rdl) - I didn't do it in Notepad, but in the Visual Studio IDE.
Searched for "matrix1_RowGroup4"; as indicated by the err msg, there were two
Incremented the name of the second/newer one to "matrix1_RowGroup5"
Naturally, SSRS being what it is, the Preview still wouldn't display at first for some bogus reason (dataset couldn't be found or some such); I went to the Data tab, and refreshed the fields, and then it was okay.

Related

Filetype error in older version of Power Query

I've made a report in pivot table in Excel 365 file by using the Power Query script, whose acquires data data form .xmlx file (previously exported from D365) by a path imported by VBA macro to named cell ("filePath").
The Power Query code starts like that:
let
Ścieżka = Excel.CurrentWorkbook(){[Name="filePath"]}[Content]{0}[Column1],
Źródło = Excel.Workbook(File.Contents(#"Ścieżka"), null, true),
AxTable1_Table = Źródło{[Item="AxTable1",Kind="Table"]}[Data],
...
Next i have some filtering and column manipulaion. I cannot share file in cause of using the business data of standard production costs lines.
The problem is that despite perfect working on PCs with Office 365, there is no way to propery runn this file on a Excell 2016. What i get is a popup window with text by second step in executing the let lines:
[DataFormat.Error] The input couldn't be recognized as a valid Excel document.
Is there a differences in loading files between these two releases of Power Query and some guidelines to ensure the enquiry working on both?
Step by step, I excluded errors with the VBA macro. I checked the file operation on four different computers (2x D365, 2x Office 2016) with the same source data. The error is reproducible in the same software version.
I need to find a way to ensure data retrieval compatibility in different versions of Power Query.

Crystal Report not filtering SQL records based on selection formula

unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.

Crystal Reports - Change report name displayed when changing the data source

I have a report in Crystal 2013, and I changed the data source from one procedure to another in the same Oracle database. That works, but the procedure name showing is still the old name. If I drill down, it shows the correct procedure name (as described in the 2nd paragraph of the accepted answer here).
However, because of how this is maintained, having that old name can cause confusion in maintaining this report. Is there a way to change the name displayed for the report so it matches the properties?
- report
- DatabaseName
+ Properties
- Old Report Name <-- I want to change this
- Properties
Table Name: New Report Name
Table Type: Stored Procedures
Owner: DatabaseOwner
Overridden Qualified Table Name:
No, by default crystal report map the variable with db field, so if you change procedure and if new column create, then report will add, if you remove, it will remove.
The same thing with procedures name, because designing of all fields in report is map with procedure's name and its fields, I don't remember, but either you can rename procedure by f2 or no option to change due to internal use.
You can change/add/remove the field name by updating datasource.
In the area where the procedure is used, either the main report or a sub-report, go to Database, Database Expert. Where the Selected Tables are listed, right-click and choose Rename.* This fixes the report name where ever it is displayed, including in formulas and the field explorer.
*F2 was mentioned in the other answer, and will work at the point of selecting the procedure name. Essentially it will work instead of the right-click. At any point before that, nothing happens with F2.

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Please help, I have been trying to fix this error for the better part of 8 hours so far. I have a report in Crystal Reports that just started throwing this error. I changed a field in the View that is attached to the report, so I opened up my XSD file in VS2010 and renamed the current DT to ViewTracker0 and then pulled in the ViewTracker view. I added my queries from the old DT, ensured that there is no primary key, double checked that each length of the fields were the same as the db, checked to make sure that each column name is named to match the DB. I can preview my data fine in the XSD, as well as in SQL I can run my queries and everything is returned correctly. When I run my report, it dies everytime with this error.
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
What do I need to check next.
Have you tried verifying the database within the Crystal Reports designer, then running the report?
Try traversing GetErrors(), described here:
http://www.fransson.net/blog/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/

How do I grep (search) a Crystal report for all uses of a column?

I am trying to remove all references to a table from a Crystal XI report. Crystal is telling me that a column from that table is currently being used, because there is a little green check mark over the field in the field viewer. Also, if I try to remove the entire table, I get a warning. The warning is almost useless though because it doesn't tell me where the field is used. Now, back when programmers were real programmers, and mice were things cats chased, I could just grep a directory or file and find all references to a variable I was interested in. But how do I do this in Crystal? I have already tried exporting the report to a Report Definition, which helped find some instances of the troublesome field. Unfortunately, that format does not include all formulas, just some. Please tell me I don't have to buy a third party app (or write my own COM thingy) just to do this seemingly simple thing.
EDIT to add details about tangential point:
In case anyone is wondering, I am not crazy - I have duplicated the issue where a formula's definition does not show up in the exported Report Definition. I created a new blank report, created one formula named stealth that returns 1234. I then used that formula in the Section Expert for the details section, in the "suppress" formula, setting it to {#stealth} == 0. the use of the formula shows up, but not the definition. So when my unwanted column was used in the formula, I was not be able to find it! Here's what the rpt def looks like (after deleting some blank lines):
Crystal Report Professional v11.0 (32-bit) - Report Definition
1.0 File Information
Report File:
Version: 11.0
2.0 Record Sort Fields
3.0 Group Sort Fields
4.0 Formulas
4.1 Record Selection Formula
4.2 Group Selection Formula
4.3 Other Formulas
5.0 Sectional Information
5.1 Page Header Section
Visible, Keep Together
5.2 Page Footer Section
Visible, New Page After, Keep Together, Print At Bottom of Page
5.3 Report Header Section
Visible, New Page Before
5.4 Report Footer Section
Visible, New Page After
5.5 Details Section
Visible
Subsection.1
Visible, Keep Together
Format Formulas
Visible: {#stealth}= 0
If all else fails ...
File -> Export -> Export Report, then choose the Report Definition (TXT) option.
That will give you a plain-text representation of every element of the report. You can grep or CTRL-F or (insert search tool of your choice) through that. "Find in Formulas" usually works, but I've had to go the export route a couple of times, for no apparent reason.
Edit: Of course, if I'd bothered to completely read your post, I'd see that you've already done this.
Very curious.
If you right click on the field in Field Explorer and select Find in Formulas, it should bring up a dialog listing all of the places it is being used in formulas. On the left hand side of the dialog is a tree of all the possible places it could be, including oddball places like record selector and page formatting functions. Unfortunately, it does not seem to list running total fields.
EDIT: Oops, all the places it exists is listed at the bottom of the dialog; the tree view is the entire "DOM" of the report.
I know this is an old post, but...
Not knocking the Find in Formulas, it's been saving me today, but i was having trouble finding the last instance of the field. Even after all of the formulas and the droppings on the report were taken care of, I still had one lone use hiding somewhere.
I found it hiding as a Subreport Link. Right click on the Subreport -> "Change Subreport Links..." and there was the culprit. Dropping in this post because I figured someone else might have this problem too.
Fields can also sometimes be hiding within "Record Sort Expert"
Responding to an old post, but ran into a similar issue. I had a group based on the formula I wanted to delete that had a specified order. When I changed the grouping to a different field, the specified order remained. When I removed the specified order, my formula could be deleted.
This was tested on XIr2...
You change the tables datasource through the "set datasource location" dialog. Now, when it goes into the column mapping mode, uncheck match-type and pick a new column that would cause an error in a formula. (i.e if the column you're looking for is a string replace it with a datetime column). Go to the preview and you should get an error box like "A string is required here.", close that error and up pops the offending formula!
One more suggestion. After following a lot of the suggestions here, my report was still telling me the formula was in use. I had to close the report. When I opened it again, the check mark was gone and it let me delete it. This was on Crystal v 11.0.0.1282
In my case the Formula Field happened to be part of an old Running Total Field, which itself was not included in the report. Once I deleted this old Running Total Field I could delete the unused Formula Field.
Very late, but i use CR 2008 (12.3.0.601) and just today (6/16/2015) i am trying to document only the formulae of my report. I knew about exporting the Report Definition, and Finding a Formula in all Formulae. But there are about 50 Formulae. I discovered that the exported Report Definition didn't document all of my Formulae, but I didn't bother to uncover the logic behind that; instead, i plopped all Formulae into a section, then exported the Report Definition. Voila. Of course, i still need to cull all the unnecessary definition elements. But at least i have all Formulae.
So with all the great selections.. I still had one instance hiding from me. I found out where it was by creating a clone of the data table and renaming\deleting the field.
I then used the "Set Database Location" as suggested above to point to my new table. It did error out when it could not find that field but still didn't tell me where it really was (it just said report field).
I did NOT map it and clicked continue which deleted the field from the report. I then mapped it back to the real table and I was good.
In my case, there was a Chart, and the field was being used as one of the "on Change" fields.
Although an old post, this functional gap still exists within Crystal Reports itself. We have a fully functional 14 day trial of our third party software that uses the latest Crystal.net API to search for plain text within a library of Crystal RPT files in one fell swoop. Also searches the data saved within reports, and text within labels ... as well as datasource behind all your reports ( stored procedures, views, and table data ) with support for SQL Server, SQL Azure, MySQL, Oracle, Amazon RDS, DB2 and Access.
More info and trial downloads at http://www.finditez.com
Note, you will need to download and install the compatible SAP Crystal.net runtime connector for searching your RPT file library.

Resources