Crystal Report not showing correct data - c#

Hi I am designing a report using Crystal Report in VS 2010 C# to show students details.
I have designed the Crystal Report like below.
and my actual database table data is
but I am getting output is
What will be the problem?

Ashok as per your question information there might not be any error in your coding but might have error in Cristal report or Application setting.
Check your both that applications and try again.

It’s not quite clear what the issue you have at the moment. But based on your comments there are few areas that I think can be gone wrong.
Check you have correct data source set up (Right click on student under Database fields and go to set data source location and check you are connected to correct database and table)
Also go to file and check whether you have save data with report option is selected. If it is unselect that option
Try go to database and do verify database
Reason behind you seeing values like ###### is definitely because of not enough space been allocated
Hope this helps

You see the "######" because the field itself is not big enough to display the data. There are two ways you can solve this:
Click on the field to highlight it. Then move the mouse along the frame until the cursor changes to an arrow that points left and right ( <-->). Click and hold the left mouse button and resize the field (just like you would resize a window).
You can right-click on the field, select Format Field, and under the common tab you can check the "Can Grow" option.

Related

ADO.NET Project

I'm trying to create a project which is basically a library management system.
As a display I used the standard DataSource to WinForm drag and drop system, which displays everything shown in the SQL table.
I want the users to be able to see the content of each row in the grid by double clicking it, which would redirect to another page with the selected row number and information to be displayed on each field.
As for the admin side, I want to be able to modify my db (delete, insert).
Is this the right path, or should I draw a grid from scratch?
Also, my SQL table contains images, this is what's bugging me.
The default gridview shows the little red X's in the varbinary column, and I can't seem to get rid of that.
Regarding inserting data into the table, is there any way to add images directly from the system above? Or should I redirect to a new page and code the respective into textboxes and things of the sort?
Thank you in advance.

need help in generating report in c# wpf

I have a program which analyses some information in runtime and save the analysis results in certain variables. I have 15 of these variables, of which, 13 are string type, 1 integer and 1 bitmap image. I want to let the user to generate a report based on the analysis data. I have been trying to search the forums for help, but couldn't find a proper solution yet.
First of all, I don't want to save these analysed results in a database (SQL etc). All i want to do is just to display the report to the user based on analysis results and let him save or print it.
This is what I did so far based on numerous hints that I get from forums. I added a report.rdlc file and created a template for the report. I also created a dataset.xsd file and added the analysis parameters to the dataset. All the dataset values are added to the report template.
Now this is where I am stuck. I don't have an idea how to proceed from here and generate a report. Right now what my program does is, upon button click, the analysed parameters will be saved in their respective variables that I specified in the main program. What I want to achieve is to use these results and generate a report as in the template. Sorry that I am not able to post images here due to the user restriction.
Any guidance on how to achieve this is much appreciated.
Thank you!
From what I recall, reports support parameters which can be injected via the presentation control.
With little else to go on, I would look here first.

View full data source in Dataset properties

I'm debugging a report (created with VS2012 Report Designer) and need to figure out from where the values are coming. Thus, I need to see the data source for each dataset. Unfortunately, the Dataset properties window is too narrow to show the full name of the data source. This is annoying since we have several data sources whose names begins with the same terms.
I've tried right-clicking, clicking the "New" button and making the window larger but without success. Does anyone know how to view the full data source name? See the attached image for what I'm referring to.

Crystal report using SQL Server data, combining two tables

Hi good people at StackOverFlow,
This morning I have found myself having a few issues with getting the correct results when attempting to view reports in my C# application using Crystal Reporting.
I'm attempting to build reports based on a user's entry when selecting an 'Employee Number' from a drop-down list within my application, so far Iv'e got the drop-down list populated with the database column records but I just cannot find a way to build a report when users select an option.
Please could someone give me an insight on how this is done or even direct me into the right place to learn how to perform such an action, I'm here to learn and would rather find my way around this issue as a means to gain knowledge rather than just simply asking for a user to fix my problem...
Thanks people!
Create your report in design with your whole table to be displayed. Then you can either create a parameter in crystal reports to filter the value by your selected value from combo box or you can set your query while loading the report with the Filtered query.
eg:
string query = String.Concat("Select * from wharever where something like ",yourcombobox.text);
Then set this query as the query to produce the report.

How to change the table name in visual studio 2013 in design mode?

I created a SQL database table in Visual Studio 2013. I want to rename it but the name property is disabled. How can I change the table name?
In Server Explorer right click on Views and click New Query.
use this code to rename table:
EXEC sp_rename 'Table', 'NewName'
then click on Execute button.
after 5-30 seconds in server explorer click on refresh button.
You can change table name in SQL Server Object Explorer in Visual Studio. Choose the table in tree and rename by right-click on the table -> rename
The correct answer as follows:
1.First select your table that you want to change.
2. Then change the name in the script pane.
3.Finally in the upper-left corner of the Table Designer, choose the Update button.
Please as shown below:
Ive been trying to too, and the simple option to rename the [dbo][Table] did not seem to work.
But it actually does! Please note that refreshing doesn't work right away.
Steps:
rename [dbo][Table] to [dbo][yourTable]
press update button
Refresh a few times, it may take a minute.
Hope this helps :) It seems a like really wierd bug.
You can change table name in T-SQL part as showin in image as follows..
CREATE TABLE{dbo].[t1]{
{
...
...
}
to
CREATE TABLE{dbo].[t2]{
{
...
...
}
ans then press "Update" button present above...
As explained here, found through "visual studio server explorer rename table", you can't.
There is a workaround: add the tables to a database diagram, rename it there and save it.
(using VS2013)
I came looking on here because I had written the main table for my project this afternoon, and as usual set it's name in T-SQL. But had not realized that the name had not stuck until I went to use it in the Linq-to-SQL I tried over and over to rename it, and I had refreshed many times.
The default name 'Table', has an obvious clash problem in normal code.
Then tonight came on here to see if you guys had found a way and opened the project to try some out.
Turns out that although the original table called 'Table' was still there, I now had many copies of it, one for each attempt at renaming it.
So I think from that we can assume the table renaming problem is a bug rather than a feature, and that MS use a copy first, then should do the deete of the file that is being renamed. But also that the refresh does not work on these copies until the project is closed and then reopened. Yes I know, a bit cheesey, but at least there is a way around.
Personally, with this and the database overwrites at run time, I am starting to lean towards letting the database designer create the scripts for my program to use rather than creating the tables and other database parts. That puts everything back into your hands, which must be a good thing.
I haven't quite got to grips with doing the Linq-to-SQL manually yet, and it is such a bonus to a programmer that I have to tackle that first.
This will help if you accidently put a dang period in your table name
EXEC sp_rename '[dbo].[Vb.Net]','VB'
Just rename the
[dbo][Table] to [dbo][TableName]
press the update button.

Categories