|
Hi,
don't use single or double quotes to insert a numeric value
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi.
I want to create some reports from my data , the data aren't in Data Base , they generates along application's process !
I need to create something like this report[^]. I don't want to use WebBrowser, because it adds header and footer ( header => page number and page's title , footer => page's path and date ) to print's pages.
What do you suggest for it ?
I would be appreciate if you guide me.
|
|
|
|
|
Hi,
why don't you use Crystal Report ? and
What is the problem you have, in using Crystal Report?
|
|
|
|
|
As I know , Crystal Report works with Data Base and DataSet !
I couldn't find any samples of Crystal Report without using DataSet because of in my App there isn't a DataSet .
|
|
|
|
|
Hi Friend,
Anyway you have some data to display.
Then you can create a Data table or dataset and
set to the crystal report data source. This can be achieved easily.
|
|
|
|
|
Thanks.
jasome wrote: you can create a Data table or dataset and
set to the crystal report data source. This can be achieved easily.
Could you please post some links about it, I don't know how I can do it.
|
|
|
|
|
Hi,
It is just enough to google, you will get the answers any way see the bellow code
DataTable dtStudent = new DataTable();
dtStudent = ConstructDataTable();
Report.CrystalReport1 objStudent = new WindowsCrystal.Report.CrystalReport1();
objStudent.SetDataSource(dtStudent);
crystalReportViewer1.ReportSource = objStudent;
private DataTable ConstructDataTable()
{
DataTable dtTmp = new DataTable();
dtTmp.Columns.Add("Id", typeof(int));
dtTmp.Columns.Add("Name", typeof(string));
dtTmp.Columns.Add("Age", typeof(int));
dtTmp.Columns.Add("Score", typeof(int));
dtTmp.Rows.Add(1, "Jacob", 24, 50);
dtTmp.Rows.Add(2, "martin", 23, 90);
dtTmp.Rows.Add(3, "Jeyakumar", 24, 70);
dtTmp.Rows.Add(4, "Manic", 23, 59);
dtTmp.Rows.Add(5, "Rosario", 27, 48);
return dtTmp;
}
|
|
|
|
|
|
Mohammad Dayyan wrote: As I know , Crystal Report works with Data Base and DataSet !
I couldn't find any samples of Crystal Report without using DataSet because of in my App there isn't a DataSet .
If you're using CR2005 or beyond, you can create a report based on data as long as it's held in one of the collection classes.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I'm using VS2008, so I think I'm using CR2008 !
|
|
|
|
|
I prefer Stimulsoft Reports
Data is very easy to set from C# objects and pricing is good.
|
|
|
|
|
I use two treeviews in my form.
These treeviews have the same nodes.
The thing that i want to do is if i scroll the scrollbar of first treeveiw,i want the scrollbar of the second to be moved automatically like first treeview.
I want to see the same nodes on first and second treeview if i scroll the scrollbar of the first or second treeview.
If u have any idea to do this, pls point me.
Thanks a lot.
axiom.kid
|
|
|
|
|
|
Thank for ur help.
The link u point me shows the thing what i want to do.Thanks
|
|
|
|
|
You can capture an event like onscroll with this[^]
and you can set new scrool position on second treeview by this[^]
|
|
|
|
|
Hi,
i have a problem with program icons. When i select a new icon for the program from application properties, build solution, copy the exe (with correct icon) to desktop, then the icon changes. I have other self-made programs on desktop as well, and the icon of the new program will become the same as the others when i copy it to my desktop. Why? Using Visual C# 2008 Express Edition, Vista
When i right click the exe, then in the properties it shows the correct icon.
Ty
|
|
|
|
|
The icon you set needs to contain icons in all the different possible sizes, or it will only be used for the sizes you provide.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It contains all of the sizes. It works correctly on other computers where there are none of my other programs with custom icons.
As a matter of fact, it works correctly in all folders where there are no other programs of mine with custom icons.
modified on Friday, September 18, 2009 6:36 AM
|
|
|
|
|
Are you setting it on the Application tab of the Properties page of the project?
|
|
|
|
|
|
hi friend,
i have two thread which share the job(thread1,thread2). how do i terminate the thread1 from thread2. is this posible? and how to return the value form the thread
Thanks in advanced
Nishar A.
|
|
|
|
|
|
|
Hi All,
Im hoping someone can give me an idea on what I may be doing wrong (if anything). In my project I have a Combo Box which I populate from a SQL Database (using a Dataset and a for statement looping through each record). I have done it on form load and it works well however I decided to run it from a background thread so I become familiar with threads and for a few other reasons.
Anyway, i have done it using a Thread but I seem to have taken a very large performance hit. Without a thread, populating the combo box (on Form_Load) it takes about 1 second. With the Thread it takes about 6 seconds.
Im assuming since Im new with threads there is something obvious in my code that is wrong. Here is the relevant code in question:-
//Create Delegates for the Threads to Access The Forms UI
private delegate void UpdateComboBox(ComboBox cboName,string strItemToAdd);
Code in the Form_load Event
//Hide the Status Label
lblStatus.Visible = false;
//Start by Enabling the Loading Circle
//This is an indicator that the Background Thread is still running
//The Background thread is connecting to the database and populating the Combo Boxes
lblLoadingFormData.Text = "Loading Data";
lblLoadingFormData.Visible = true;
lcFormData.Active = true;
//Create the Thread which will Update the Combo Boxes
Thread thrPopulateComboBoxes = new Thread(this.PopulateComboBoxes);
thrPopulateComboBoxes.Start();
Code to Populate the Combo Box
private void PopulateComboBoxes()
{
//This Method will Populate the ComboBoxes on the Form
//Customers
ArrayList al = new ArrayList();
//Customers Combo Box
al = myDatabaseFunctions.PopulateComboBox("SELECT Name FROM tblCustomers ORDER BY Name ASC", "Name", "Customers");
foreach (string s in al)
{
this.Invoke(new UpdateComboBox(this.AddItemToComboBox),new object[] {cboCustomer,s.ToString()});
}
}
I know the issue is not with the Arraylist as this is the same sort of code I am using in a non thread and the performance is fine
Finally the code to add to Combo Box
private void AddItemToComboBox(ComboBox cboName, string strItem)
{
cboName.Items.Add(strItem);
}
Can any1 offer some thoughts as to why Im taking such a performance hit? Am I doing something wrong with the threads?
Thanks in advance,
Daniel.
|
|
|
|
|
When Invoke is called from a worker thread, it sends a windows message to the UI thread which then runs the delegate. You are doing this for each string in your results, which will be slow.
You could run the db call on a worker thread and then call Invoke once with the entire ArrayList to populate the ComboBox .
Also, you should probably use a thread pool thread for this, either directly or using a BackgroundWorker .
Nick
----------------------------------
Be excellent to each other
|
|
|
|