I want to fatch data from sql server stored procedure in creating a crystal report.
How to do that.
Please Help
Just create the Stored Procedure in your database and the set the DataSource in the Crystal Report to the Stored Procedure you have just created.
Using Stored Procedures to create Crystal Reports
Related
I need suggestion/best approach to address the below problem:
On insertion of a new record into a DB2 table, a file needs to be generated and stored remotely on real time
Env. DB2/zOS
If Mdb file is created for MSAccess then what file is created for Informix , and what is the path for it
What do you want to do with that?
Most databases I know do not work with only one file which can be easily copied between machines. For Informix there is ROOTPATH parameter in ONCONFIG file which points to initial chunk of root dbspace. If it sounds strange then you should read more about Informix architecture and Informix administration.
If all you want is to copy database than you can use dbexport DATABASE_NAME which will create directory with SQL (schema) and text data files. Those files can be imported with dbimport DATABASE_NAME.
There is no database "file" like MS Access or SQLite, which are server-less databases, for Informix databases.
Accessing data from an Informix database requires some sort connection with the database server. Search for Informix drivers for more info.
If you're interested, I know from experience that you can connect to an Informix server using MS Access via an ODBC driver. This would give you a familiar interface in MS Access while directly working with Informix data.
If you are able to do some light programming, I would similarly suggest setting up Informix for ODBC, then connect to the database using an ODBC driver in chosen language. I have done this using Go, Python, and R.
I try to display a PDF file (stored in the DB as image field) in my report. When I display it in an image object, the image object appears empty.
What am I doing wrong or is there another way to display PDFs in a FastReport report?
I'm using Delphi Embarcadero XE6 and FastReport V5.1.
Use TfrxPictureView and assign it with your database field
If you have already converted all PDFs to JPEG and then stored them as JPEGs in the DB, then TfrxOleView will be able to display them.
If not, you need to create a custom report component derived from TfrxReportComponent and handle its Draw event. The Draw event should get the PDF blob, convert it as a metafile/bitmap, and then draw the metafile/bitmap on the canvas of the custom control. This custom component needs to be used in your report instead of the TfrxPictureView control. (Check FastReport's Developer manual for more information.)
You will need a PDF library to convert the PDFs to metafile/bitmap. (I recommend my company's product PDFtoolkit for this.)
PDF-to-JPEG conversion takes time and may slow down your reports. So, I would advise you to first run the conversion on your DB and store the images in another column. That way, you don't have to write any custom report component. You just refer the images column/field.
I am using TOleContainer to Access Excel from Application. in Olecontainer objects we have MS Excel 2003 worksheet, but I need to open Excel Workbook 2010 version. Can any one help me.
Thanks.
Use TOleContainer.CreateObjectFromFile. From the documentation (link to current documentation, but TOleContainer hasn't changed in ages so it's relevant to the version of Delphi you're using):
Creates an embedded OLE object from the contents of a file.
Call CreateObjectFromFile to create an OLE object from the file specified by the FileName parameter. The Iconic parameter indicates whether the object is shown as an icon (true) or displayed as it would be in the server application (false). If there's already an OLE object in the container, it is destroyed and any changes the user made to it are discarded.
A sample of use would be:
OleContainer1.CreateObjectFromFile('C:\temp\test.xlsx', False);
You can also use TOleContainer.CreateObject, if you know the class name of the OLE class. You can find that by using CreateObjectFromFile as I've shown to load an existing Excel file and the reading the TOleContainer.OleClassName. (This is also available in the documentation.) An example using the same version of Excel I have for the above:
OleContainer1.CreateObject('Excel.Sheet.12', False);
I created a simple DataSnap REST server in Delphi XE2 and i have a method which returns a TStream object to transfer a file. This works well but when i try to download a big file (~2,5GB) i got an
"out of memory"
error message on the server side.
I would like to download the file via internet browser (http://localhost:8080/datasnap/rest/TServerMethods1/GetFile).
Can rest service return big files?
I read this question and tryed that solution which works well when i use a small file.
Here is my simple code:
function TServerMethods1.GetFile: TStream;
var
FileStream: TFileStream;
begin
FileStream := TFileStream.Create('d:\file.exe', fmOpenRead);
Result := FileStream;
end;
How can i download a big file from a REST server via internet browser?
The result of your function is a TStream, try to increase the amount of memory for your application How can I enable my 32-bit Delphi application to use 4gb of memory on 64-bit windows (via Wow64.exe)?
Anyway, you are loading a very big amount of data. You should create a function which gives you the result in more small chunks.