본문 바로가기

Web Program159

Automatically Printing Crystal Reports 1 Using Server-Side ReportDocument.PrintToPrinter Method This server-based method is documented in the Visual Studio help files. Open the Help Index, and enter PrintToPrinter in the "Look for:" box. The syntax for this method is: Report.PrintToPrinter(, , , ) 'Collated' in this context has nothing to do with database collation. Some advanced printers (like copier/printers) will sort each document .. 2009. 5. 15.
DB에 저장된 이미지 불러오기 // Put user code to initialize the page here MemoryStream stream = new MemoryStream (); SqlConnection connection = new SqlConnection (@"server=test;database=pub;uid=sa;pwd=1234"); try { connection.Open (); SqlCommand command = new SqlCommand ("select image from Image", connection); byte[] image = (byte[]) command.ExecuteScalar (); stream.Write (image, 0, image.Length); Bitmap bitmap = new Bitmap.. 2009. 5. 14.
이미지를 db에 저장하기 // Create a byte[] from the input file int len = Upload.PostedFile.ContentLength; byte[] image = new byte[len]; Upload.PostedFile.InputStream.Read (image, 0, len); // Insert the image and comment into the database SqlConnection connection = new SqlConnection (@"server=test;database=pub;uid=sa;pwd=1234"); try { connection.Open (); SqlCommand cmd = new SqlCommand ("insert into Image " + "(Image, m.. 2009. 5. 14.
Crystal Reports TextObject ignores newline, carriage return, \r\n I have a text object in my crystal report, and i set the value programatically for it, using something like this: (rpt.Section3.ReportObjects["txtDate"] as TextObject).Text = DateTime.Now.ToShortDateString();this works fine, until you put a string with line breaks inside it, specifically \r\n or the carriage return character. This is a bug in CR for .Net, you can read the official blurb here. th.. 2009. 5. 14.