PDA

Click to See Complete Forum and Search --> : How to view image files without specifyng file's path


victor64
Jun 3rd, 2009, 07:52 AM
Hello,

I am trying to use crystal reports to view PNG files listed in ACCESS, without specifying the files’ path, the PNG files are on the same path as the application when the application is installed. Can you please help me with the proper syntax from the ACCESS table or .NET code to view the PNG files without specifying the files’ path. I would like to give the users the flexibility to install the program to the folder of their choice.Dim myaop6report As New AOP6Annex
Dim myaop6viewer As New AOP6VIEWER
Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo

crConnectionInfo.ServerName = (Application.StartupPath & "\AOP6Annexes.mdb")
setDBLogonForReporta(crConnectionInfo, myaop6report)
myaop6report.RecordSelectionFormula = "{image.SN} like " & "'*" & 100 & "*'" & ""

With myaop6viewer
.CrystalViewer22.DisplayGroupTree = True
.CrystalViewer22.ReportSource = myaop6report
.Show()
End With
Me.Cursor = Cursors.Default
The Image table currently looks like this

SN IMAGE
100 c:\Program Files\AOP6\Image1.png
100 c:\Program Files\AOP6\Image2.png
100 c:\Program Files\AOP6\Image3.png
100 c:\Program Files\AOP6\Image4.png

Thanks,

Victor

Hack
Jun 3rd, 2009, 07:59 AM
The program has to know where the files are unless you want to code in a disk wide hard drive search when they want to view them.

By default, install them in the project folder. You can build in a feature for the user to move them to a folder of their choice later using an interface you will provide. This interface will store the path the users have chosen and feed it to your program if your program can't find the files in the project folder.

I've been doing that kind of thing for years. Typically I will store the file path in a db table field.

victor64
Jun 3rd, 2009, 08:12 AM
Sorry, I don't quiet follow your comments. Can it be done without writing the files' path in the database field?. The /image.png doesn't work, but I think there's a way to do it from ACCESS.