here is my situation. I have created a DataSet, in my projet, that is linked to my Crystal report. Howhever, when I run the application and that I look at my report, there is decimal on all of my numeric fields. How can I remove them?
For your information, when I right-click on one of these numeric field, I don't have a format option (probably because it comes from a DataSet and not directly from the DB, I can't tell exactly).
Thanks
You don't see the Format Field... option in the context menu? Is the field inside a text object? You can select the field inside the text object and get the Format Field option. Then you go to the number tab and use the Customize dialog to set the number of decimal places displayed.
Related
I have an RDLC Report Table which retrieves data from a SQL Server.
I've embedded this report into an ASP.NET Web for (.aspx file) using the ReportViewer Control.
When I run the application the Data is retrieved from the SQL Server.
However, I need to have a column where the user has the ability to place a tick mark in the cells of that column.
Obviously I'm able to add a column to the Report itself in the .RDLC file but I'm not able to figure out how to get the tick mark for the user working.
Any ideas how this could be achieved?
Not 100% sure what you mean by:
Obviously I'm able to add a column to the Report itself in the .RDLC file but I'm not able to figure out how to get the tick mark for the user working.
I mean, we don't have a check box control for RDL reports.
And RDL seems to struggle with boolean values.
However, for given columns?
Add a column to the data source/query - cast the boolean column to number - it will still spit out 0 (false) and 1 (true).
Then in the RDL report, you have two choices:
You can add/drop in a check box image, and display it based on the value of the colum above.
But if you want a check box, and un-checked?
You can drop in a indicator. There are a few built in ones. Pick the one with a check box and a "x" for un-checked. it has a seperator also built in - remove that.
So, you get this:
So, using that indicator - 0 to 0, it will display the X, and for 1 to 1, the check box.
You get this effect:
So, it not sure if you ONLY want a check box for true rows, or you want a check box, and a un-check box as per above. You not limited to using a "indicator" on the report, but it for sure the easy road if you need both check and X.
You also are free to input a image, and only show it as true for the column in question that has true values. However, you can't stuff two images into a single column, so indicator becomes the better choice.
Edit: this is only for display - user can't change these while viewing report.
So to be clear, this gets you display, but does not get or give you ability to check or uncheck the boxes in the report.
If you need that ability I'm afraid you are out of luck.
You might be able to present data in a grid view or better yet a listview, allow users to check/ uncheck and then have a view report button.
This also suggests that the data has an extra column for this purpose.
I don't believe that rdl reports have this interactive ability
I am using an if-then conditional in a Crystal Reports formula. I want to display just one record in report based on the results of the conditional. For example:
if(....)="H" then "Habbits" or if(.....)="I" then "Indoor"
How can I achieve this?
I think you need to show data like Habbit, Indoor etc based on condition.
Follow these steps If I am correct in guessing the question:
Create a new formula field, and add the condition in the same.
stringvar nameofvar:="";
if(....)="H" then nameofvar:="Habbits"
else if(.....)="I" then nameofvar:="Indoor"
//If there is a problem in this formula then specify
Drag the formula field from field explorer to the area on the report where you want it to show.
I have an rdlc file with cells showing decimals.
How do I convert a negative number to have parenthesis?
I can't display it as a string, because when the report is exported it treats in as a string and throws an error that the number could not convert a string.
I've tried adding #,0:c0 for the format property but this didn't work.
Any suggestions?
Try to not use the Format function in the Expression of your Placeholder, instead in the text box (or cell) properties, you can set the type and the format of it.
In the properties, there is a section called Number in which you specify that the textbox must contains numbers of a specificated category.
Here is an image to explain:
As you can see, there is an option to set how to display negative numbers (the one selected).
Now, I'm sure that this will works if you export the report in PDF but I hope this will be the same for Excel's export
I worked it out, sorry to answer my own question.
if I use the following in the format property #,0;(-#,0) it works fine.
In my case below custom expression solved my problem.
''#,0.00;''(#,0.00);
I have two datasets I need to pull from, A base that both reports use and then a separate one that only one report pulls from. I get the error
Error 12 The Value expression for the text box ‘Textbox9’ refers to
the field ‘Name’. Report item expressions can only refer to fields
within the current dataset scope or, if inside an aggregate, the
specified dataset scope.
My best guess is I have to associate them with the correct dataset but I have not been able to find any documentation on this.
edit: I am trying to access property files that I created for the fields on the report document.
Can someone please tell me where in the rdlc document I need to code something like name.value, "dataset1" or something similar?
When you create a table in a RLDC, in the Tablix properties (selecting a row or a column) you must associate a DataSet.
After doing that, you have to write in each cell the name of the field (in the dataset) that you will use. You can do that by clicking on the "little table" in the cell, when you put the mouse over it
In images (with Visual Studio 2010)
If you don't see the dataset in the list, you must add it.
For that, click on view menu -> report data.
Then, in the DummyDataSource, click Add Dataset..
And select it from the list, or create a new one instead, in the same form.
If this doesn't work, well I don't know haha
If the two datasets has the same structure, then you could use one just, and in the code assign it to the datasource
I ran into this same error and the only way I could resolve it was by closing and reopening BIDS and then refreshing the fields from the stored procedure (Right click the data set -> Dataset Propoerties -> Query -> Refresh Fields).
Thanks for the troubleshooting tips!
If you are trying to embed the results of one set into a table that is using another data set, have you considered a subreport?
After some careful research and error checking I found that I had to create my base model property file and when I drag the actual data points on to my form I had to associate them with their correct set:
I clicked the value and associated the correct dataset.
I've got a datagridview that is hooked up to a bindingsource on my main form. One of the columns and datamembers in the bindingsource is a DateTime object. When the datagridview shows this item it doesn't use Window's default region settings for displaying datetime.
The weird thing is, I can access this same DateTime object and print it to a text box, or even pass it off to another form with another datagridview and binding source and it actually shows up properly in that table.
So then, why does the datagridview on my main form not use the regional date/time settings when converting the DateTime object to a string?
I've checked that there was no special formatting applied to the datagridview and so I'm running out of ideas to check.
Do you guys know if there is any super secret way to get a datagridview to follow system regional format rules or not?
Also, since I highly doubt that I did something different with this datagridview vs the others in my application, the next potential area for issue could be on application load: Perhaps since this comes up when the application loads, it's not getting the same cultureUI settings as the other datagridviews?
Update I've tried adding another column to the datagrid view and hooking it up to the same data property (datetime) and I get the same result. So something about how entire datagridview, or how it was created is stopping the "ToString" from using the default regional settings.
Any Help?
On design, in the Edit Columns dialog of the DataGridView:
Search for property DefaultCellStyle, and open this dialog;
Search for property Format and choose Date format;
Choose your favorite format.