1- I have a shared dataset that gets style properties from SQL server by calling a stored procedure. These are, for example, a field with an array of color codes.
2- I load the shared dataset within a dataset embedded in my report ("use a shared dataset").
3- I create a hidden parameter "color" which available values are set to None; Default values are set to "Get values from a query" and value field is set to the color array in question.
When I run the report, I get the "parameter is missing a value" exception. What's weird is that I have another report running the same settings that works perfectly fine.
Any tips?
You need to have both the Available Values and Default Values pointed to the query. Also check the "Allow multiple values" setting in your parameter properties. Depending on how you're using the parameter values throughout the report, you may need to make use of the Join and Split functions to pull out the individual values from the array, but that would be a separate issue.
Related
We have labels in JIRA. This "labels" is predefined field and not a custom field as I observed.
The labels are auto-complete fields and any value can be assigned to it.
I want these labels to pick values only from a set of values. Is there a way to do this?
Also, is it possible that the set of values can be uploaded from a list/excel/csv?
The easiest way to do this would be to add a custom field with your required settings (a single value or maybe a multi-pick selection).
I use the Jira Cloud solution and I'm not aware of any way to import values into custom fields. If you have a local installation and have a developer to help you might be able to find a way to import them but I'm guessing it might be easier/faster to do it manually even if there are a hundred or so.
My goal is to have a TGrid with several columns, connected to a TClientDataSet via LiveBindings. One of the columns is of type TProgressColumn.
The grid displays the data, but the progress bar column shows nothing (i.e. 0% progress).
The TProgressColumn is connected to a field of type ftInteger. The values in this field are between 0 and 100.
I've tried with ftSingle, but with no luck.
I set the type of the column to be TProgressColumn via ColumnStyle property, available under TLinkGridToDataSourceBindSourceDB/Columns.
The strange thing is that when I use TPrototypeBindSource to generate values - the TProgressColumn works, but only for ftUInteger values. It fails for ftInteger generators.
Here is a little demo (Delphi XE7):
When I put a breakpoint in TProgressCell.DrawCell() and step over the two conditions for Value.IsOrdinal and Value.IsType are skipped and ClampValue receives a value "Min" which is 0.
There seems to be something wrong with the value, passed to the function.
Is there something special when working with TProgressColumn? Do I need to use CustomFormat, CustomParse in TLinkGridToDataSourceColumn?
Is that a bug or I miss something?
UPDATE:
Thanks to "nompa" the mystery was solved!
In fact "asInteger" is the well known property of the TField class i.e.:
someDataSet.fieldByName('myFieldName').asInteger
In CustomFormat property you can get access to many things, including self.asInteger properties.
More information here:
Using Custom Format and Parse Expressions in LiveBindings
Using binding expressions in the CustomFormat property of a TLinkPropertyToField component
Formatting your Fields
How to treat an Integer field as a Boolean?
The value is string by default, not matter is a integer field. In property CustomFormat write AsInteger.
The value will be take as integer and the progress now is visible.
I have a parent report that feeds one of the field values into a subreport. But the problem is that there this field value can include multiple records. For simplicity, assume that this field value is called color, where possible values might be orange, red, and green. I need to pass all of these value to the subreport, not just one. I have tried passing the values this way into the Color parameter of the subreport:
=Fields!Color.Value
But this doesn't work and gives me an error. I have also tried:
=join(Fields!Color.Value,",")
This also gives me an error on the subreport
I have also tried both of the above as an expression in a textbox in the parent report and I get #Error displayed on the parent report. I was able to successfully get just the first value to appear by using a similar expression and the First function. But I am not able to get all of the values to display in this textbox on the parent report? how can I do this or at least pass all of the values to this subreport?
The easy solution is if Color is already a parameter - I would pass this expression in the subreport:
=Parameters!Color.Value
If Color is not a parameter, I would add a column to the driving dataset in the parent report using a SELECT ... FOR XML to concatenate the relevant Color values together. Then you can pass that field to the subreport.
I have 3 fields, Action1, Action2 and Action3 contained in one report. Each Action field is selected from the same list of values. I would like to graph a count of these values by the value of the field and not field itself. I need one graph and not one graph per Action field. I have tried to combine the field values into an array in the details section, but the report shows the concatenated string values "Action1, Action2, Action3', as a single value in the graph. I tried to graph using "on change of", but it will only allow 2 fields and not 3. Is there a way to count these values regardless of the Action field where they are found?
I have been working with Crystal for years, but can't figure this out for whatever reason.
I was never able to find a solution to this issue inside of Crystal Reports itself. What I ended up doing was creating a stored procedure in SQL to use as the data source. In the stored procedure I basically performed a cross join such that there was only 1 Action returned per record. In CR I then was able to summarize the Action field values.
So I'm messing around with a new project in Delphi 2009 and the default components that can be dropped onto a form for accessing data consist of a SQLConnection, DataSource and SQLQuery. If I add a simple select to the query component, say:
select name from customers
and then drop a DBComboBox on the form and link it up with the DataSource I get a single record in the combo box. After using Google for half and hour to figure out what I was doing wrong it looks like you have to manually add some code to your project which loops through the dataset and adds all the records to the drop down box. Something like:
while not SQLQuery.eof do
begin
DBComboBox.items.add(SQLQuery.fieldbyname('name').asstring);
SQLQuery.next;
end;
And that actually sort of works, but then you get a list in the drop down which you can't actually select anything from. Regardless of the result though I'm wondering why would you even use a DBComboBox if you have to manually add the result of your query to it? Seems to me that if it doesn't automatically populate the db combo box with the result of the query then we might as well be using a non-data-aware component like tcombobox.
I guess what I'm asking is why does it work this way? Isn't the purpose of data aware drag-and-drop controls to minimize the amount of actual written code and speed development? Is there a method that I'm missing that is supposed to make this easier?
A TDBComboBox doesn't get its list of values from the database; it gets its current value from the database. Link it to a field in your dataset, and when you change the active record, the combo box's current value will change. Change the combo box's current value, and the corresponding field's value will change.
If you want to get the list of values from the database as well, then use a TDBLookupComboBox.
This is all covered in the help:
Using TDBListBox and TDBComboBox
Displaying and Editing Data in Lookup List and Combo Boxes
Defining a Lookup List Column
I think you want the TDBLookupComboBox because that allows you to lookup from a list of items where the list comes from a dataset.
In the TDBComboBox, the list is just a TStrings manually filled with data.
--jeroen
DbCombox is a dbaware version of the standard combobox component.