Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > มีวิธีการทำหน้ารายงาน โดยไม่ใช้ crystal report ใน VB.net หรือ C#



 

มีวิธีการทำหน้ารายงาน โดยไม่ใช้ crystal report ใน VB.net หรือ C#

 



Topic : 059665



โพสกระทู้ ( 91 )
บทความ ( 0 )



สถานะออฟไลน์




มีวิธีการทำหน้ารายงาน โดยไม่ใช้ crystal report ใน VB.net หรือ C#

พอดีผมทำรายงานจาก crystal report แล้ว convert มาเป็น Excel
ปัญหาของผมคือ พอแสดงผลใน Excel แล้วหัวข้อมันมันเอียงๆไม่ตรงกับ ข้อมูล

พอจะแก้ไขได้แบบไหนบ้างครับ



Tag : .NET, Ms SQL Server 2005, Crystal Report, VB.NET, C#, VS 2005 (.NET 2.x)







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-05-04 12:13:59 By : Neptune29 View : 2799 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (VB.NET)
Dim dt As New DataTable()
' object of data row 

Dim drow As DataRow
' add the column in table to store the image of Byte array type 

dt.Columns.Add("Image", System.Type.[GetType]("System.Byte[]"))
drow = dt.NewRow
' define the filestream object to read the image 

Dim fs As FileStream
' define te binary reader to read the bytes of image 

Dim br As BinaryReader
' check the existance of image 

If File.Exists(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg") Then
	' open image in file stream 

	fs = New FileStream(AppDomain.CurrentDomain.BaseDirectory + "10157.Jpg", FileMode.Open)
Else
	' if phot does not exist show the nophoto.jpg file 

	fs = New FileStream(AppDomain.CurrentDomain.BaseDirectory + "NoPhoto.jpg", FileMode.Open)
End If
' initialise the binary reader from file streamobject 

br = New BinaryReader(fs)
' define the byte array of filelength 

Dim imgbyte As Byte() = New Byte(fs.Length) {}
' read the bytes from the binary reader 

imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)))
drow(0) = imgbyte
' add the image in bytearray 

dt.Rows.Add(drow)
' add row into the datatable 

br.Close()
' close the binary reader 

fs.Close()
' close the file stream 

Dim rptobj As New CrystalReport1()
' object of crystal report 

rptobj.SetDataSource(dt)
' set the datasource of crystalreport object 

CrystalReportViewer1.ReportSource = rptobj
'set the report source 



http://www.codeproject.com/KB/vb/Image_in_Crystal_Reports.aspx






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-05-06 18:17:15 By : webmaster
 


 

No. 2



โพสกระทู้ ( 7 )
บทความ ( 2 )



สถานะออฟไลน์


ถ้าจะใช้ Excel อ่าน ลองสร้าง Excel ไฟล์โดยตรงเลยไหมครับ ถ้าสามารถอ่าน xslx (Office 2007-2010) ได้ก็ลองใช้โค้ดช่วยสร้าง OpenXML ไฟล์อย่างเช่น
http://closedxml.codeplex.com/wikipage?title=Showcase&referringTitle=Home

แต่ถ้าต้องเป็น xls ก็คงต้องพึ่ง Office Automation นะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-05-07 09:45:50 By : karlkim
 

 

No. 3



โพสกระทู้ ( 91 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-05-07 19:00:28 By : Neptune29
 


   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : มีวิธีการทำหน้ารายงาน โดยไม่ใช้ crystal report ใน VB.net หรือ C#
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่