our company has a VB6 program that uses crystal report CRAXDRT9.dll v9.2.0.448 to generate report, yes we are using Crystal Report 9.
so today I am trying something new, inserting image into the report from database BLOB field. I have tried putting both bmp and jpg image file into the BLOB field, both of them can successfully show the image in Crystal Report application while editing the rpt file and Preview, or when exporting a pdf file from the Crystal Report application.
However when I put everything to the report system, where there are some job scheduling, submitting stuff, and the last leg was a small VB program that uses the dll to generate the report, everything else was fine, even data from the same table can be shown, but not the image in the final exported pdf file.
May I know if there is any specific settings I have to configure while I perform this type of action?
code excerpt from the VB program I believe is related to report export settings
Set crxReport = New CRAXDRT.Report
.
.
Select Case datPrimaryRS.Fields(conExportTypeColumn)
Case 0 'PDF
crxExportOptions.DestinationType = crEDTDiskFile
crxExportOptions.FormatType = crEFTPortableDocFormat
crxExportOptions.DiskFileName = txtFileName ' grdDataGrid.Columns(conExportPathColumn) & grdDataGrid.Columns(conExportNameColumn)
crxReport.Export False
Frankly, it seemed to me simply choosing pdf export type and export to local disk, I don't see much else, perhaps it is some other settings that are missing?
Related
I have several access databases that I export out of either in Excel or PDF. Now I am told that i need to add watermark to all of my exports. However, I am not sure if this is possible or if it can be done. Do you know how I can add a watermark to a an export out of access saved as PDF or Excel file.
I created code to export to excel and email the file. I also created an add-in in excel that inserts the watermark. I dont know how to use together.
This is the code I am using to export to excel and email:
Function ExportDailyPayoffs()
Dim dtemnyr As String
Dim mondt As String
If Weekday(Date) = vbMonday Then 'Check to see if its Monday
dtemnyr = Format(Date - 3, "mmddyy") 'We want to get the file for Friday
Else
dtemnyr = Format(Date - 1, "mmddyy") 'We want to get the file for Friday
End If
DoCmd.SendObject acSendQuery, "A1 Daily Payoffs", acFormatXLSX, "CLSS#xxxx.US", , , "Daily Payoff Report - " & dtemnyr, "Enclosed please find the Daily Payoff Report", True
End Function
I want the word(watermark) CONFIDENTIAL to be in the excel when it gets exported out of access or email to anyone.
Adding a watermark to a .pdf output is straightforward. In design view, a report has a Picture property. That picture can be a watermark, created as a graphic file. The watermark is under all of the text, borders, etc., as if it's part of the paper on which the report is being printed, but to see the watermark properly you need to set the controls' background to transparent. If the watermark is a fairly unsaturated (pastel) color, then the text will be quite readable over the watermark.
Adding a watermark to Excel output is harder. I know of no way to do it directly within Access. I recently needed to do something similar, reformatting Excel output to modify column widths, let selected columns' contents wrap, and so on. I did it by writing an Excel workbook to do the reformatting of the exported workbook. Immediately after I export a workbook, the VBA code which exports it then opens the reformatting workbook, which auto-executes to perform its work and then closes itself. This isn't the right place to explain all of the details, but that's the general approach.
I am working on an SSIS-2012 project, where I am receiving dataset after executing a stored procedure and saving the data in an excel file using an "Excel Destination" task in data flow. It works well, however I have a problem that for some fields, the width of columns are not large enough to show the value. Some numbers are shown like ##### for example, or part of a sentence instead of whole the end user sees etc.
Usually I handle this problem in Visual studio using a code like:
for (int i = 1; i <= RAWDATA_COLUMNS.Length; i++)
{
worksheet.Column(i).AutoFit();
}
However, here I could not find a way to handle it in SSIS. Writing a script to receive the data and save it into Excel file is not an option, using Excel Destination task in data flow is a must. Any help or advice would be appreciated.
I am facing strange with the PDF printing with Foxypreviewer in Visual foxpro while trying to print multiple reports to one pdf using "NOPAGEEJECT".
We have some reports, which are supposed to be printed on in the vertical direction while other reports are supposed to be printed in the horizontal direction.
Now I get all pages in the same direction, depending on which direction the first report in the template have.Sample code is given below which I am trying to print to pdf:
REPORT FORM Itinerary01 object type 10 NOCONSOLE NOPAGEEJECT
REPORT FORM Itinerary02 object type 10 NOCONSOLE
Please help me to solve this.
The magic is that if I run these file one by one then only the last one will go for pdf but when I selected both and execute, the result was OK.
You are running files from command prompt so you can not get desired result. Put these command in a prg and see the magic.
REPORT FORM LOCFILE(_Samples + "\Solution\Reports\Colors.frx") ;
OBJECT TYPE 10 NOPAGEEJECT NORESET TO FILE "d:\Test.pdf"
REPORT FORM LOCFILE(_Samples + "\Solution\Reports\Percent.frx") ;
OBJECT TYPE 10 PREVIEW
This might be something that I am overlooking, as I am currently reading a book on VB.NET. I canceled a course in VB.Net recently because I was stuck on a problem and the lecturer did not get back to me with my questions that I had.
The objective was to create a business application with VB.NET that writes data from text boxes to a text file, seperated by a comma or a pipe. The user of the application must be able to select the directory where they want the file to be saved.
So I have for example 2 forms, one that captures the data for a client, and another form where you can select from a drop-down control, Now I know that streamwriter allows for the user to select self where they want the file to be saved, but how do I make the second form intelligent to know where the user saved the form and then reads the client_id, and fills the other data associated with the client_id to the text boxes in the form. I know streamreader is the one to use when you want to read data from a file, but how will streamreader know where the user will save the file to?
I am not doing the course any more, but I will keep on thinking what I could have done to actually get the project to work.
For writing to file
// Write single line to new file.
Using writer As New StreamWriter("C:\log.txt", True)
writer.WriteLine("Important data line 1")
End Using
For reading from file
// read from a file
Dim line As String
Using reader As New StreamReader("file.txt")
line = reader.ReadLine()
End Using
Console.WriteLine(line)
Stack!
I'm currently trying to code a neat little function in Visual Basic that deletes my entire file system for my program depending on the contents of one text file.
If my text file contains the number 0 by itself, my file system will be deleted. If it contains a 1 by itself, it will not delete the file system and carry on with its pathway of execution.
the problem I'm having is reading the file, then assigning the text file's contents to a variable (string), which then is used in an if statement to decide whether it deletes (then immediately recreates) the file system, or keeps it. Ideally I'd be using this primarily for when the user installs. By default, it is set to 0 so that it clears any stored content, then after creating my directory, the number turns to 1 so that it does not reset my programs content directory.
Here's my code. The first line is giving me difficulties -
Could not find file 'C:\Users\110fa_000\documents\visual studio 2013\Projects\Novation_Launchpad_Emulator\Novation_Launchpad_Emulator\bin\Debug\0'.
fileReader = File.ReadAllText(My.Resources.FirstTimeUse)
If fileReader = "0" Then
FirstTimeUse = True
End If
If you can help me, that'd be absolutely brilliant. I don't think there's any more information I can give sadly, but everything regarding the function, purpose, and error is there.