CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2884|Reply: 8

tutup connection crystal report dlm asp.net - vb.net

[Copy link]
Post time 5-2-2009 12:46 PM | Show all posts |Read mode
aku dah mati akal...tak tau camana nak tutup connection yg dibuka oleh crystal report.

Aku buat code utk convert dari format crystal report ke pdf....code tu jadik, tapi masalahnya connection yg dicreate oleh crystal report tu tak boleh tutup. Nie code yg aku buat :-

        Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
        Dim rptSource As New ReportDocument
        Dim a As String

        'Stop buffering the response
        Response.Buffer = False
        'Clear the response content and headers
        Response.ClearContent()
        Response.ClearHeaders()

        'Response.Write(Server.MapPath("prtmyiKEWtry.rpt"))
        'a = Server.MapPath
        rptSource.Load(Server.MapPath("prtmyiKEW.rpt"))
        crLogonInfo = rptSource.Database.Tables(0).LogOnInfo
        crLogonInfo.ConnectionInfo.ServerName = "*****"
        crLogonInfo.ConnectionInfo.UserID = "****"
        crLogonInfo.ConnectionInfo.Password = "****"
        crLogonInfo.ConnectionInfo.DatabaseName = "****"
        rptSource.Database.Tables(0).ApplyLogOnInfo(crLogonInfo)
        rptSource.Refresh()
        rptSource.SetParameterValue(UCase("sElmCode"), "*****"))
        rptSource.SetParameterValue(UCase("sStartDate"), "26/01/2009")
        rptSource.SetParameterValue(UCase("sEndDate"), "26/01/2009")
        rptSource.SetParameterValue(UCase("sIC"), "*****") 'CStr(info(0)))
        rptSource.SetParameterValue(UCase("sName"), "Ahmad")
        rptSource.SetParameterValue(UCase("sNoStaf"), "Ahmad")
        rptSource.SetParameterValue(UCase("sPTJ"), "Ahmad")
        rptSource.SetParameterValue(UCase("sBankName"), "Ahmad") 'info(4))
        rptSource.SetParameterValue(UCase("sAccNo"), "Ahmad") 'CStr(info(5)))
        rptSource.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "Customers")
        rptSource.Dispose()
        rptSource.DataSourceConnections.Clear()

        GC.Collect()
        GC.WaitForPendingFinalizers()


tlg advice...
tq
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 10-2-2009 09:35 AM | Show all posts
adeh....takder sapa2 ke yg bole tolong?     
Reply

Use magic Report

Post time 12-2-2009 01:24 PM | Show all posts
ko xbuat pon path filedestinationoption.. imports crystaldecisions.shared...

response ????

response.charset =""
response.writefile(crDiskFileDestinationOptions.DiskFileName)
response.flush()
response.close()


tp btol ke coding atas tuh jd bila eksport..... errorr kuar apa tuh.....  aku xtahu kikiki.....
Reply

Use magic Report

 Author| Post time 14-2-2009 01:38 AM | Show all posts
naikAntena..
code tu jadik...tapi bila aku tgk kat processes dlm sybase admin, ada crystal tu tak close connection tu. bayangkan kalo 1000 org akses page aku tu, so maknanya 1000 conn yg akan dicreate.

arghhh tension...skang nie tepaksala user print form je la dulu sampai aku boleh solve prob tu.
Reply

Use magic Report

 Author| Post time 14-2-2009 01:42 AM | Show all posts
sebelum nie aku guna code lain dan berjaya close connectio tu...so dgn bangganyer aku bgtau bos aku kejayaan aku tu...so beliau pon nak aku launch system asap.

tapi bile nak sampai date tu, aku dah upgrade version sybase aku tu coz nak solve satu pob yg dah aku tinggalkan 1 thn lamanya. hasilnya ; prob lama selesai, create prob baru     
Reply

Use magic Report

Post time 17-2-2009 03:16 PM | Show all posts

Balas #5 aks_berhad\ catat

hahahahaha... mcm2 ko nih.. besa arr tuh.. selalunyaa apa yg kita siap buat mengundang lebih banyak request ngan problemm... kuikui.. saborr je larrr....
Reply

Use magic Report

Follow Us
 Author| Post time 26-5-2009 12:45 AM | Show all posts
yeah...aku da dapat solution utk masalah tu...aku guna dataset.
so connection yg dibukak kat sybase cuma 1 conn shj.....

sekian...case closed
Reply

Use magic Report

Post time 26-5-2009 02:49 PM | Show all posts
nk wat setFocus() camner ek..asal ak nye x jd...
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 26-5-2009 11:14 PM | Show all posts
set focus?
tu function dlm apa? dataset?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

15-6-2024 10:42 PM GMT+8 , Processed in 0.066044 second(s), 35 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list