Click here to Skip to main content
16,009,728 members
Home / Discussions / C#
   

C#

 
GeneralRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Dave Kreskowiak25-Jul-07 9:39
mveDave Kreskowiak25-Jul-07 9:39 
GeneralRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Paul Conrad25-Jul-07 9:48
professionalPaul Conrad25-Jul-07 9:48 
GeneralRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Dave Kreskowiak25-Jul-07 13:46
mveDave Kreskowiak25-Jul-07 13:46 
GeneralRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Paul Conrad25-Jul-07 13:52
professionalPaul Conrad25-Jul-07 13:52 
AnswerRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
martin_hughes25-Jul-07 8:49
martin_hughes25-Jul-07 8:49 
AnswerRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Gyan Jadal25-Jul-07 9:40
Gyan Jadal25-Jul-07 9:40 
GeneralRe: High performance: DataGridView1.DataSource = MyDataTable (100,000 rows) Pin
Dave Kreskowiak25-Jul-07 10:09
mveDave Kreskowiak25-Jul-07 10:09 
QuestionCrystal report dynamically load an image on report document Pin
bemahesh25-Jul-07 6:11
bemahesh25-Jul-07 6:11 
Hi
I have a crystal report invoicing application that generates invoices. i have a logo on that invoice. I wanted to change the image based on if some condition met on code behind.

Can anyone please shed some light on how to do this.

This is what i am doing currently.


private void CreateImageDataTableAndWriteSchema()
{
this.DsImages = new DataSet();

DataTable ImageTable = new DataTable("Images");

ImageTable.Columns.Add(new DataColumn("path", typeof(string)));


ImageTable.Columns.Add(new DataColumn("image", typeof(System.Byte[])));

this.DsImages.Tables.Add(ImageTable);

//this.DsImages.WriteXmlSchema(@"c:\myinvoices\ImagesSchema.xsd");
}

as you can see from commented code that, I am creating an xsd dataset and I have added that dataset to the database fields. Then i have place image field from that table on to the report document. Then below i am loading an image file in that dataset/datatable.
then i am loading image in to the dataset created above

private void LoadLogoImage()
{
FileStream FilStr = new FileStream("C:\\mystuff\\Images\\my_logo.jpg", FileMode.Open);
BinaryReader BinRed = new BinaryReader(FilStr);

DataRow dr = this.DsImages.Tables["Images"].NewRow();

dr["path"] = "C:\\mystuff\\Images\\my_logo.jpg";

dr["image"] = BinRed.ReadBytes((int)BinRed.BaseStream.Length);

this.DsImages.Tables["Images"].Rows.Add(dr);

FilStr.Close();

BinRed.Close();

}


Lastly, i am setting the datasource of the report document as following

reportDocument.Subreports[SummaryDocument].Database.Tables["Images"].SetDataSource(DsImages.Tables["Images"]);

I get error, invalid index when i try to execute this line.


As stated above, i am trying to set the Images table datasource to the dataset we just poppulated with image path and byte data.


fyi: i have a master report which holds 8 subreport. The SummaryDocument listed above is one of those subreport.

Thanks
Needy

Questionproblem Pin
sarvenaz8425-Jul-07 6:06
sarvenaz8425-Jul-07 6:06 
AnswerRe: problem Pin
leckey25-Jul-07 6:14
leckey25-Jul-07 6:14 
AnswerRe: problem Pin
Luc Pattyn25-Jul-07 6:42
sitebuilderLuc Pattyn25-Jul-07 6:42 
AnswerRe: problem Pin
Dave Kreskowiak25-Jul-07 7:31
mveDave Kreskowiak25-Jul-07 7:31 
AnswerRe: problem Pin
Paul Conrad25-Jul-07 7:35
professionalPaul Conrad25-Jul-07 7:35 
Questionchange a db value of 1 to "Administrator" Pin
Boyd Lowry25-Jul-07 5:53
Boyd Lowry25-Jul-07 5:53 
AnswerRe: change a db value of 1 to "Administrator" Pin
Luis Alonso Ramos25-Jul-07 6:15
Luis Alonso Ramos25-Jul-07 6:15 
AnswerRe: change a db value of 1 to "Administrator" Pin
Eliz.k26-Jul-07 22:13
Eliz.k26-Jul-07 22:13 
QuestionDataGridView and System.ComponentModel attributes Pin
Jon Hulatt25-Jul-07 5:21
Jon Hulatt25-Jul-07 5:21 
AnswerRe: DataGridView and System.ComponentModel attributes Pin
Judah Gabriel Himango25-Jul-07 5:53
sponsorJudah Gabriel Himango25-Jul-07 5:53 
QuestionShred secured folder access Pin
ThaScorpion25-Jul-07 5:15
ThaScorpion25-Jul-07 5:15 
AnswerRe: Shred secured folder access Pin
Dave Kreskowiak25-Jul-07 7:28
mveDave Kreskowiak25-Jul-07 7:28 
Questionuser's current wallpaper Pin
likefood25-Jul-07 4:28
likefood25-Jul-07 4:28 
AnswerRe: user's current wallpaper Pin
ashukasama25-Jul-07 4:53
ashukasama25-Jul-07 4:53 
GeneralRe: user's current wallpaper Pin
likefood25-Jul-07 5:01
likefood25-Jul-07 5:01 
QuestionHow to make setup & deploy a Pocket Pc application Pin
Raza Hussain25-Jul-07 4:19
Raza Hussain25-Jul-07 4:19 
AnswerRe: How to make setup & deploy a Pocket Pc application Pin
Jalpesh B. Patel25-Jul-07 4:21
Jalpesh B. Patel25-Jul-07 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.