SSRS - Fields working in Data Set, but won't appear in report - sql

I have a data set that gets its values from a stored procedure, and I'm positive that the stored proc is working correctly since I'm getting results in SQL Server. However, when I call the fields in an expression (for example, =Fields!CustomerName.Value) and preview, it just displays a blank spot in its place. If I simply typed some text in that spot, the text does appear when I run it.
The DataSet IS working, and it's refreshed to show all of the fields. They just don't display anything in the report, despite definitely returning values when I check in SQL Server. Does anybody have any suggestions as to what steps I could take to fix this?
Thanks.

Try referencing your dataset explicitly, by changing this:
=Fields!CustomerName.Value
To this:
=Fields!CustomerName.Value,"MyDatasetName"

Related

delphi create sql select statement at runtime

I am attempting to create a sql statement in XE8 at runtime to search an oracle database based on the value in a textbox. I find multiple different ways that attempt to explain this online, but I am not understanding what it is asking.
I want to search a server based on a select statement and populate TDB components (labels only) based on the data. The furthest I have gotten is to get data populated, but the where
' ... somevalue = ' + textbox.text;
seems to have no effect.
What components do I need to make this happen? I am connected to the database, and it appears that I can get some kinda data out of it, but I can't seem to figure out how to filter the results. Obviously, I cannot create this sql statement at design time as the value of textbox.text will change depending on the user's input.
My error was in how to dynamically change what the data aware components got data as it would not always be the same. I had to manually go in and modify their datafield properties. Once I did this, my query functioned correctly.

Get concrete value in Pentaho Report Designer

Let me explain my problem,
in Pentaho Report Designer I want to build such a report, where I have one data set, i.e. one request to database
SELECT code, name FROM EMPLOYEES
and show result of this request not in the form of list, but put every result in appropriate place. i.e. like in below picture
Where field "code" is unique, just one result can be put into red label in picture.
How can I do this in Pentaho Report Designer?
I can solve this problem by creating 3 data set, for each of caption. But what if captions like this will be much more, creating requests for each of this caption will not be so effective.
Hope I could explain my question.
I don't know if I got it right, but If you want to use the values returned by your query, you could create a new formula called "your_formula":
=MULTIVALUEQUERY("name_of_your_query")
This will give you an array with the result of the query. Then you could use another formula to get the 1st result of the array. For example:
=ARRAYLEFT([your_formula])
and get the first result of your query. This way let you use your_formula as parameter. This means you can drag and drop it on your report and use it.
I hope it helps.
Regards,
Tatan.

Access Query uses Form Inputs as Parameters - Runs manually, not through Form

I have a query that accepts input from a form. The query works as expected when I run it, manually typing in the form input values. However, when I run the query from the form, the query returns blank - no error, just blank.
I don't understand what's causing it - at it's most basic, the user is simply entering a Start and Stop date. I'm entering the data exactly the same, and made sure my form text box is formatted as a date.
Furthermore, when I run the form, I am not prompted for any values, so I know it's reading them accurately. This system works for several similar queries, but not this one.
What I've tried
Changing the format of the text box to specify Short Date (which is how I type it)
Visually confirming the values are making it from the form to the hidden staging area the query references - these values match what I manually enter into the prompts
The query I'm runnning references another query; running the other one by itself only yields one set of "date" prompts, not two. So I created a seperate date input box for each to read off of, but to no avail
Question: Does Access try and format (or not format) parameter input boxes differently than it would handle form references?
Additional detail - when I run the query manually, it prompts me for the dates twice - I don't know why or it's pertinent, but I thought I'd mention it.
use instead Temporary variable in your Query for the specified dates. After you select the dates from the Form, make sure that the values are assigned to the temporary variables and that you requery the record source of the form
I was able to get this working by tweaking my query in the designer - specifically by splitting up my expression into multiple pieces and writing the criteria in segments.
I'm not sure why this did the trick, but it at least got me where I needed to go.
Good luck to anyone else experiencing this!

How do I get the index of each record displayed on crystal reports?

I'm developing winform application using vb.net. I use crystal report in my application. Now i need to store the index of each record that is displaying in current report into database. Then i create another report which displays the index of all the records. My plan is to read the page number of each record and save them on database. I have a group field in the report. I don't know how to scan one by one record and get appropriate page number. I tried the following code to get the field value but did not work.
msgbox(rpt.DataDefinition.FormulaFields("name").Text)
It displayed the formula of that field.
I don't know in which order the records fetched using following.
msgbox(rpt.rows(0).item(0))
Please Help me out....
The way your question reads, it sounds like you're trying to generate an "index" for the order records appear in a report and store that index in a database for use in another report. I am not clear at all what you're trying to do with the page number.
In any case, I need to make something clear: the definition of the report (which you're accessing in your code sample) only represents where data will go when the report is formatted - it is not the actual data itself.
At the most basic level, Crystal Reports takes data out of a database and formats it nicely for you on pages. Rather than trying to take data out of a database, put it into a report, then try to read that report to put it back in a database to make another report, why not just do all your data manipulation at the database level itself before going to a report in the first place?
If you really must have that first report, the easiest option you'll have for getting at the formatted data is to export it to excel and access it programmatically through an Excel API - Crystal Reports doesn't have an API for getting at your formatted data (including things like generated page numbers, whatever you're trying to do with them).
You are trying to break few basic rules. For example a report should never change the data. The right way is to handle data processing in a stored procedure or command and to call the report in a separate process. In such way you will be able to control the data change and data visualization separately.
P.S. You probably mean "Identifier" not "Index"

Dynamic SSRS report

I had a problem in creating the Dynamic report in SSRS. My problem is:
In a table I have stored SQL scripts with the column SQLScripts. If you execute these SQL scripts you get different number of columns for each script.
My problem is, I have one report with buttons of these scripts, for example test1, test2...like that. If you press test1 button this should take the test one SQL script and should display the report with appropiate columns in that sqlscripts.
I can't create individual reports for each test report, they are plenty. Are there any options for me to solve this problem...
The only way I've been able to get this to work sofar is:
Each report has 2 datasets.
ReportData
DataHeaders
The "DataHeaders" need to have the proper name of the datafields in "ReportData". Be careful since SSRS replaces blanks and special characters with "_"
Now, create a table (or matrix) and drag the DataHeaders as the Columns of your report. (This should be a grouped column). If you run it at this point, you'll see all your columns without any data. Now comes the magic:
Create another report that takes a "DataField" parameter. Create another table or matrix within this report and set it's dataset property to be "ReportData". In the DATA cell for the table, set it to the expression =Fields(Parameters!DataField.Value).Value
Now go back to your first report. Right click and insert a subreport. Right click on the subreport and select "Subreport Properties". Under general, select the second report you created to be used as the subreport. Under parameters, select the DataField parameter and set its value to something like =Fields!DataField.Value
In my case I did some formatting in this expression to fix the above mentioned issue with spaces and special characters, since my stored procedure was initially used in ASP.NET and this was just a proof of concept.
Also in my experience the performance isn't great. In fact it was kinda slow, though I haven't had a chance to switch it to use a shared dataset, which I suspect would help a bit. Please let me know if you find a better solution.
I have not found a way to do this completely dynamically. Here is a similar question with some possible solutions:
How do i represent an unknown number of columns in SSRS?
You basically need to create a 'master dataset' from the other Datasets that are based on your multitude of SQL scripts first.The master dataset should contain the data to be presented in it's most simplistic form, i.e. in a simple list format.
Finally, go to the toolbar in SSRS and drag a 'Matrix' into the report. A Matrix table acts similar to a pivot table in Excel or a CrossTab query in Access that will display whatever's in the Dataset.