15,908,264 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by lucasgrohl (Top 25 by date)
lucasgrohl
22-Nov-10 4:25am
View
My databatle is being filled through code:
MySqlCommand mscGeneralInvoiceData = new MySqlCommand("SELECT tb_c.company_name, tb_c.corporate_name, tb_c.company_registration, tb_c.address, tb_dt.doc_type_cd, tb_pt.payment_type_name, tb_pt.payment_type_description, tb_i.invoice_code, tb_i.dt_invoice, tb_i.total_value, tb_i.observation, tb_i.tax_percent, tb_cd.company_name, tb_cd.company_address FROM tb_client AS tb_c INNER JOIN tb_invoices AS tb_i ON tb_c.id = tb_i.tb_client_id INNER JOIN tb_doc_type AS tb_dt ON id_doc_type = tb_i.tb_doc_type_id_doc_type INNER JOIN tb_payment_type AS tb_pt ON tb_pt.id = tb_i.tb_payment_type_id INNER JOIN tb_company_detail AS tb_cd ON tb_i.tb_company_detail_id = tb_cd.id WHERE invoice_code = \'" + _invoiceNumber + "\';", bdConn);
MySqlDataAdapter mscDAdtGeneralInvoiceData = new MySqlDataAdapter(mscGeneralInvoiceData);
mscDAdtGeneralInvoiceData.Fill(dtGeneralInvoiceData);
reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2_DataTable1", dtGeneralInvoiceData));
When I debug I see that all the fields are filled. But some of them doesn't appear on the report. Although all the other are ok.
lucasgrohl
21-Nov-10 10:12am
View
Strogg, what I did was to use cstr() in each field. Now everything is working. I have no idea of why it wasn't but now it is ok.
Finally, I finished my application! =) Tomorrow will be the presentation day.
Because of you I have finished it in time!
Thanks a lot man! =)
lucasgrohl
19-Nov-10 16:06pm
View
Well, I used a new DataSet and as I it's with the right case, otherwise I think the DataTasble that is being used as a DataSource wouldn't even be populated. It has to be in the same report because this report needs to encompass 2 DataTables (each one in different DataSets).
And in this case I can't even send you the project for you to see because you wouldn't have the data base... =/
Are there any way to debug in run time what is being passed to the form and loaded in it? I mean, check all the steps and verify in run time what is in each field?
Thanks!
lucasgrohl
18-Nov-10 8:54am
View
I am sorry mate, just one simple question... I must be doing something wrong...
I created another table with all the other fields I need and added them to some text boxes in my Rdlc. Some of them appear correctly, but some doesn't appear.
Also, one of the text boxes is receiving 3 of the fields... 2 appear ok, but the last one doesn't appear.
They are like this in one textbox:
="TO: " + First(Fields!corporate_name.Value, "DataSet1_DataTable2")
+ First(Fields!company_registration.Value, "DataSet1_DataTable2")
+ First(Fields!company_address.Value, "DataSet1_DataTable2")
The company address doesn't appear.
Do you have any idea about what can be going wrong?
I am sorry! =/
lucasgrohl
18-Nov-10 7:16am
View
Man, thanks a LOT!!! Now it works!!! It is alive!!! =D
What I did was to update the databinds on the Report Viewer control and it worked perfectly!
Now is just do it for the rest of the stuff and my system will be complete!
Again, thanks a lot for your time and patience to help me!
lucasgrohl
18-Nov-10 2:09am
View
I check all the items.
I changed my DataTable1's fields name in my DataSet1 to the same name as it returns in my DataTable dtInvoiceDescriptionDetails
The values in the table in my Rdlc are:
=Fields!detail_description.Value / =Fields!detail_value.Value / =Fields!ind_taxible.Value
(the same name as in my datasource datatable)
I checked the data straight after it has been filled in on the code. It is full populated.
I changed the Dataset Name to "DataSet1_DataTable1".
And the Rdlc is in the project, so I don't need the add its path.
When I execute the programme there is no error. Only the data doesn't appear.
The table in my Rdlc shows the hearder with the name of the fields, but no data.
Any idea? =(
thanks!
lucasgrohl
16-Nov-10 19:53pm
View
Strogg,
I created a DataSet, named DataSet1, and added a DataTable in it, named DataTable1, with the fields "field1", "field2" and "field3".
I added the DataSet1 as a DataSource to my Report1.rdlc through the visual mode and dragged and dropped the DataTable1 fields into my table contained in my Report1.rdlc
Now, in the RepF_Load my code is filling in my DataTables as shown in my question and at the end I put the code:
private void RepF_Load(object sender, EventArgs e)
{ ...
reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1_DataTable1", dtInvoiceDescriptionDetails));
reportViewer1.RefreshReport();
}
But, when I execute the program it is still empty.
Do you have any idea of the reason this is not working yet?
Thanks! =)
lucasgrohl
10-Nov-10 0:48am
View
Even when I create a public method that returns a DataTable I can`t find it when I add the class this method is contained in my Report1.rdlc data souces.
lucasgrohl
5-Nov-10 5:28am
View
I tried the solution described on the link - http://www.gotreportviewer.com/objectdatasources/index.html
But when I create a method which returns a string, for example, I cant't see it after adding the class this method is contained as my RDLC data source.
Any idea?
lucasgrohl
4-Nov-10 13:06pm
View
PS: I am not using a DataSet. I only have those 5 DataTables. If it is really necessary to use a DataSet, how can I create a DataSet and Include those 5 DataTables into it?
Thanks!
lucasgrohl
4-Nov-10 5:31am
View
Thanks a lot man! You really helped me! Now it works perfectly fine! =)
lucasgrohl
4-Nov-10 5:09am
View
Now I think this is more clear =)
lucasgrohl
4-Nov-10 5:07am
View
Principal -> Form that contains the GET property to access the textBox2.Text (where I already have the invoice number generated). This form uses newForm.ShowDialog()
newForm -> Form that needs to get the information contained in textBox2.Text to use as a clause in my SQL statement.
I think now it is more clear =)
lucasgrohl
4-Nov-10 4:52am
View
I got it. Makes sense. In fact I am using showDialog() in the form where the user enter the invoice number to open the new form (the one I want to access the property in the parent form). But how can I access this variable (in the parent form)?
I asking you because what happens is, I have a form where an user enter all the details of an invoice (client, payment type, etc), and then the system generates automatically the invoice number. After that the user clicks on the button "Create invoice" and the system registers the invoice on the database and asks if the user wants to print it. If the user clicks yes, the system opens a new form containing a reportviewer and user the invoice number (generated in the parent form), to colect the rest of the informations on the database.
Got it?
lucasgrohl
3-Nov-10 3:32am
View
The first point I got. But, I have 5 MySqlDataAdapters which fill 5 DataTables. Can I add these 5 MySqlDataAdapters into the same DataSet?
The second point I didn't get because I am using Microsoft Report Viewer, not Crystal Report.
lucasgrohl
2-Nov-10 7:10am
View
Thanks! You helped a lot! =)
lucasgrohl
1-Nov-10 10:19am
View
Thanks but the error occurs as well. I don't understand, do I have to initiate the Cells Content or any other thing?
lucasgrohl
1-Nov-10 7:15am
View
Pawan Kiran
I replaced the code for the one you pasted above. What is happening now is:
1 - If one one the columns is empty (not even has been clicked), occurs the same error
2 - If both columns are filled, it works for the lines that are filled. But, when the for command reaches the last line (the blank line dataGridView creates automatically), occurs the same error
I think the second case will be solved if first one is solved. But, I am not understanding why it is not working if I also included the 'null' verification in the if conditions.
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (dataGridView1.Rows[i].Cells["Column1"].Value.ToString().Length == 0 || dataGridView1.Rows[i].Cells["Column1"].Value == null && dataGridView1.Rows[i].Cells[1].Value.ToString().Length != 0)
{
MessageBox.Show("You must enter a description for each value.");
return;
}
if (dataGridView1.Rows[i].Cells["Column2"].Value.ToString().Length == 0 || dataGridView1.Rows[i].Cells["Column2"].Value == null && dataGridView1.Rows[i].Cells[0].Value.ToString().Length != 0)
{
MessageBox.Show("You must enter a value for each description.");
return;
}
}
Can you help me?
Thank you so much for the support you're giving me!
lucasgrohl
1-Nov-10 5:13am
View
After I tried it, nothing happened. I mean, the code stopped at the same point as before.
I understand, in this case, both Cells are already initialized, right?
lucasgrohl
1-Nov-10 5:01am
View
I replaced the previous code for:
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (dataGridView1.Rows[i].Cells[0].Value.ToString().Length == 0 || dataGridView1.Rows[i].Cells[0].Value == null && dataGridView1.Rows[i].Cells[1].ToString().Length != 0)
{
MessageBox.Show("You must enter a description for each value.");
return;
}
if (dataGridView1.Rows[i].Cells[1].Value.ToString().Length == 0 || dataGridView1.Rows[i].Cells[0].Value == null && dataGridView1.Rows[i].Cells[0].ToString().Length != 0)
{
MessageBox.Show("You must enter a value for each description.");
return;
}
}
But the error persists =(
lucasgrohl
1-Nov-10 0:51am
View
Hum, I see that. Thank you very much for the advice. For sure this is gonna solve many of my problems! =)
lucasgrohl
1-Nov-10 0:49am
View
Thank you very much! That is exactly what I needed and now it is working fine =)
lucasgrohl
1-Nov-10 0:37am
View
When I execute the application with this code it shows me the message: "Object reference not set to an instance of an object."
Any idea of what it can be?
PS: I set this column as typeof(double) in the Form Load event and I am also using a column format as C2(currency). In this case, after entering the value, it puts the symbol $ in front of the value. Can it interfere in anyway?
lucasgrohl
29-Oct-10 12:24pm
View
Deleted
I did the adjustments but it is not working. Do I have to create an instance of the method dgrid_CellValueChanged in somewhere?
Thanks!
lucasgrohl
29-Oct-10 7:15am
View
The problem is that this is for when I already have the data stored. In my case, the user is typing the values and the sum of all the cells of this columns has to be shown in run time in a label. =/
Show More