|
I am creating a crystal report from C# dot net(windows), as of now i found tutorial and books to do that by taking the records from the data base tables.
Now what i have to do is that to print the report from the spooled datatable, ie the record from the datatable,
how to pass the datatable as a parameter.
as of now from the data base,
myreport rpt = new myreport();
crystalreportviewer1.reportsource= rpt,
this is working fine, and printing the records from the data base table.
now i have to pass the data table to the report?
how to do that
waiting for reply.
|
|
|
|
|
Bold text is used to emphasise specific words. If you use it on all text it only makes it harder to read.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
set the datasource of the report to your datatable.
rpt.datasource=datatable
On a side note:
'Hello peoples' = not a good subject line
And like Guffa said all bold text doesn't help, it only makes it harder to read
|
|
|
|
|
Guys,
sorry after typing the subject when i press enter
tag came and i didnt noticed that,
after posting only i noticed and it was in bold, and when i try to change that net connection got down.
sorry,...
|
|
|
|
|
I have created the report using the dataset, inside that datatable having one column.
myrpt rpt = new myrpt();
but here as you told rpt.datasource is not comming for me,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CareVoyant.DAL.Helper;
using CareVoyant.Sys.Configuration;
using CareVoyant.BLL.Billing.Claims;
using CareVoyant.DAL.Billing.Claims;
using CareVoyant.BLL.Helper;
//using System.Xml;
//using System.IO;
using CareVoyant.BLL.Billing.ClaimsEditCheck;
using System.Data.Sql;
using System.Data.SqlClient;
am i missing any namespace or refference??
awaiting for your reply.
|
|
|
|
|
My mistake it should be:
rpt.SetDataSource(datatable)
|
|
|
|
|
Hi,
This is on C# Windows application, I want to build Caching mechanism generally that need to store some files and send back to me when i ask. Is there any good build in mechanism in C# or We need to use Enterprise Library to get this done?
Thanks
|
|
|
|
|
You can use the ASP.NET caching in WinForms or anywhere in .NET by referencing System.Web.dll
|
|
|
|
|
Dear Team,
I created two different threads and by using dataadapter i filled two different datasets. which have no relations among them and i want to bind/merge the two dataset into single dataset and bind them to the gridview.
private void button1_Click(object sender, EventArgs e)
{
Thread thread1 = new Thread(new ThreadStart(Procedure1));
Thread thread2 = new Thread(new ThreadStart(Procedure2));
//Thread thread3 = new Thread(new ThreadStart(Procedure3));
thread1.Start();
thread2.Start();
loaddata();
}
private void Procedure1()
{
OracleConnection con = new OracleConnection(ConnectString);
OracleCommand command = new OracleCommand(" select * from CIHOLDDETAILS", con);
OracleDataAdapter da = new OracleDataAdapter(command);
//da.TableMappings.Add("Table1","Holddetails");
da.Fill(ds,"HOLDDETAILS");
//da.Fill(dt);
//dt = ds.Tables[0].Copy();
}
private void Procedure2()
{
OracleConnection cn = new OracleConnection(ConnectString);
OracleCommand cmd = new OracleCommand(" select * from CIINSPECTIONREPORTS", cn);
OracleDataAdapter orda = new OracleDataAdapter(cmd);
orda.Fill(ds2, "CIINSPECTIONREPORTS");
//dt2 = ds2.Tables[0].Copy();
}
private void loaddata()
{
ds3.Merge(ds);
ds3.Merge(ds2);
dataGridView1.DataSource = ds3;
}
here i tried to merge the dataset but it is giving error as :Collection was modified; enumeration operation might not execute.
i think becouse of different datatypes and different table it is giving. but how to handile it
or there any alternative way of doing this
please help me out in this problem .
Thanx in Advance
|
|
|
|
|
I need to write an arrays by coulms
i have the following array
a1={1,2,3,4,5,6}
a2={7,8,9,10,11}
.
.
.
.
an={10,11,12,13,14,15}
and i want to print it as
1 7 ... 10
2 8 ... 11
3 9 ... 12
4 10 ... 13
5 11 ... 14
6 12 ... 15
|
|
|
|
|
Aren't you really really able to figure out how to accomplish such task (you know array elements may be accessed by indexes...)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
what about this code? I'm supposing that you have all arrays in a list called aListOfArrays.
int iColumnCount = aListOfArrays[0].length;
for(int iCurColumn = 0; iCurColumn < iColumnCount; iCurColumn++) {
for(int iCurArray = 0; iCurArray < aListOfArrays.Count; iCurArray++) {
System.out.print(" " + aListOfArrays[iCurArray][iCurColumn].ToString());
}
System.out.println();
}
Does this help you?
Regards
Sebastian
|
|
|
|
|
You helped him in doing his homework.
Now I am expecting another question for converting java into c#
*jaans
|
|
|
|
|
Shame on me
I'm expecting a question like: "Now I have to add all numbers together..."
|
|
|
|
|
thank you Sebastian
it worked with me so good i appreciate you help.
the rest of you guys , i am sorry that i am not genius as you, but i don't think there is problem to get some help with other and i guess that's the whole point of this form
i know i am not professional and i didn't say that i am but i am doing my best in learning
modified on Friday, January 16, 2009 6:18 AM
|
|
|
|
|
I have developed a Windows Control Library that is called from a web page .
All works fine, but if I open a modal dialog from my Windows Control Library, I got this message:
Microsoft .NET Security Warning
Never enter personal information or passwords into a window unless you can verify and trust the source of request.
Source: 192.XXX.YYY.ZZZ
Thanks in advance
modified on Friday, January 16, 2009 5:34 AM
|
|
|
|
|
Hi,
what do you mean by suppress? You could use a try-catch, where you catch all exception with the type SecurityException.
Regards
Sebastian
|
|
|
|
|
OOps sorry for Improper Information!!
Thanks for replying
actually
I have developed a Windows Control Library that is called from a web page .
All works fine, but if I open a modal dialog from my Windows Control Library, I got this message:
Microsoft .NET Security Warning
Never enter personal information or passwords into a window unless you can verify and trust the source of request.
Source: 192.XXX.YYY.ZZZ
Thanks in advance
|
|
|
|
|
|
Basically, you can't disable the warning. You have no control over it at all. The only thign you CAN do is rewrite your control so your code doesn't trip the warning. Your control is doing something, or using something, that is not allowed in the restricted sandbox of the web browser.
|
|
|
|
|
My wife uses her laptop at 3 different locations, all which require a different smtp server. In earlier versions this information was store in the registry and very easy to change, however I can't find it there anymore and was hoping someone here has crossed this path before. I am new to the Outlook api so forgive me if this seems simple.
She messes things up worse when she manually tries to do this at one site since some of the other settings, port, logon, etc also has to be changed there.
If anyone knows where in the api I can hit to do this it would be great, thanks ahead of time
Schott
|
|
|
|
|
DID YOU EVER FIND OUT YOUR ANSWER?
|
|
|
|
|
In the book C# 3.0 in a Nutshell, chapter on threading, the author while explaining the locks, says:
"The following class is not thread-safe: if Go was called by two threads simultaneously, it would be possible to get a division-by-zero error, because val2 could be set to zero in one thread right as the other thread was in between executing the if statement and Console.WriteLine."
class ThreadUnsafe
{
static int val1, val2;
static void Go( )
{
if (val2 != 0) Console.WriteLine (val1 / val2);
val2 = 0;
}
}
The author then gives the following class and says that:
"In this case, we're protecting the logic inside the Go method, as well as the fields val1 and val2."
class ThreadSafe
{
static object locker = new object( );
static int val1, val2;
static void Go( )
{
lock (locker)
{
if (val2 != 0) Console.WriteLine (val1 / val2);
val2 = 0;
}
}
}
My question:
I get that two threads cannot enter the lock construct at the same time, but still one thread can(I guess) modify the static variables as the other is executing the if statement, which would again lead to a division by zero error. What I dont' understand is that how this lock construct protects the static variables from being modified by other threads.
Furthermore, if the static variables can be modified, what is the use of this lock construct and what exactly the author meant?
Thanks
|
|
|
|
|
Hi,
so let me try to explain this.
The lock construct itself just helps the programmer to serialize multiple threads trying to accessing a critical path in an application. The lock statement itself doesn't protect the static variable, it is "protecting" the path within the construct. What the programmer does within the critical path is up to himself, so the lock construct doesn't know anything about the static variable.
If the programmer is not strict enough and access the lock static variable outside of an lock-construct (Attention: locking over the same lock-object) than the lock construct itself is useless.
What the author meant (in my opinon) is that he wants to make clear that the programmer has to be aware that whenever he/she wants to access a critical variable (or accessing a critical path) he has to use locks.
Does this help you a bit?
Regards
Sebastian
|
|
|
|
|
Thanks for the answer.
I think that locks are more of a design thing, they do not protect anything(object..) by themself, but only restrict other threads to enter a code,, so the programmer is left with the arrangements of the lines-of-code that do and donnot modify a variable.
I think the nutshell author was wrong when he said that the lock protected the variables, when infact it was the arrangement of the code such that no line-of-code which modified the ...
So would you say that locks
I'm confused
Could you refer me to a book or an article that would not say that "lock enforce exclusive access to a resource", when infact(I think) they dont, and tell exactly what locks do and any good programming practice related to locks?
Thanks
|
|
|
|