Ian Branch
Members-
Content Count
1352 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Ian Branch
-
Hi Thomas, I'm afraid I don't know where/how to do that. Can you show me an example or two please? Regards & TIA, Ian
-
Hi Team, D11.3. I have a multi component App with several tabs on a form. All works as designed/expected. Recently I have tried to add a button or a label or something else o one of the tabs, it builds OK but when run I get a 'Class "abcdef" not found.' error with "abcdef" being the added component. It's not peculier to the tab either, it happens if I just want to add a component to the form. Anybody seen this before? Is it a known issue? Have I reached some limit? Is there a cure? Regards & TIA, Ian
-
I FOUND IT!!! For whatever reason I had the following order at the start of the unit.. type .... .... private .... .... const .... .... public .... .... end; Something in me said this didn't look/feel right so I changed it to type .... .... private .... ... public .... .... end; const .... .... and all is fine now. Exactly why I had the const in the private section, I can only specualte that I was trying to make the consts private...... FWIW, this is the const declaration.. const sNoSvcEmail : string = 'There is no Service Email Address recorded in the Company data!'; sNoCorpEmail : string = 'There is no Corporate Email Address recorded in the Company data!'; sPrintMsg : string = 'The Job Ticket not in the correct status for this print function!'; // The following are for IndexOrd. aIndexOrd : array of string = ['Job #', 'Customer Ref.', 'Job Status', 'Account Code', 'Job Type', 'MSN', 'ESN', 'User ID', 'Account #', 'Customer #', 'Service #']; aSortOrder : array of string = ['JobNo', 'CustomerRef', 'JobStatus', 'AccountCode', 'JobType', 'MSN', 'ESN', 'UserID', 'AccountNo', 'CustomerNo', 'ServiceNo']; Anyway, all good now, I can add components again to my hearts content. Thank you all for your interest and suggestions/contributions. Very much appreciated. Regards, Ian
-
I am suspecting the latter. I removed all the plugins and the issue still occurred.
-
No they aren't inherited. I tried creating a brand new form, adding all the components and code as per the original and got the same issue in the new form. 😞 Strange.
-
Hi Uwe, It's a case of 'I don't know what to tell you' that might help/clarify the issue. 🙂
-
As far as I can tell, yes. But the button was just an example, it doesn't seem to matter what extra component I put on the form.
-
Hi Team, I have jpegs saved into TTable Blob fields. 1 per record. How do I extract and print that jpeg to the PCs Printer please? I have made several 'attempts' without success. Regards & TIA, Ian
-
Hi Team, D11.3. I need to be able to load a .pdf file to a TTable blob field, and display the blob/pdf on a form. I can load the .pdf to a blob field no problem, but I can't figure out how to display it. It would be nice if there was the ability to zoom in/out for viewing. I would expect the display .pdf to change as the TTable changed records. Looking for suggestions/ideas. Regards & TIA.
-
Hi Thomas, Hmm.. food for thought. It is only happening on one form out of 20 in the project. It also happens to be the most complex form. I presume you are referring to the Components name property? i.e. it was blanked for some reason. I would have thought that would have stopped it from compiling, let alone running.. It happens if, for example, I copy an existing button already on the form. Builds OK but as soon as I try open that form with say a Button1.enabled := true;, I get the error. :-(
-
I have, and have looked at that, but it has too many limitations att. I need zoom in /out plus some other caabilities that I have mentioned to Bruno.
-
Hi Team, One last aspect. I don't need to att, but if the Customer asks, where/how would I incorporate a printersetup dialog so they could select the printer and parameters? Regards & TIA, Ian
-
Success!!!! I looked at the contents of the link and there were two things not in our code. Title & Copies. I took a punt and added a Title. "LPrinter.Title := 'Test';" and it all works. 🙂 I don't know if this is a Win11 thing or a Printer thing, but it is at least resolved. Thank you all for your contributions and p2k for your patience. Regards, Ian
-
Nope. That didn't work. I can see it in the queue but it isn't printing. 😞
-
Yep. Same result.
-
No progress at all for the printing of the image. It just sits there in the printer queue. No privilages needed.
-
I can see them in the Printer Queue as they print.
-
Yup.
-
Yup. 🙂
-
Yep. Did that. All works fine. It is a LAN connected Printer. Word, PDF, emails, etc all print OK. I can print a jpg from IrfanView fine.
-
Drivers reinstalled. Same issue. 😞
-
I have just implemented you code. procedure TJobTicketsForm.btnPrintImageClick(Sender: TObject); var // temp for memory works... LPrinter : TPrinter; LJPEG : TJPEGImage; LJPEGStream : TMemoryStream; LBitmapToResize : TBitmap; begin LJPEGStream := TMemoryStream.Create; LJPEG := TJPEGImage.Create; LBitmapToResize := TBitmap.Create(1, 1); try // my field BLOB with only "JPEG" files!!! any other raise an exception!!! // header: ($FF, $D8, $FF); // 255, 216, 255 (dmC.jtImages.FieldByName('JTImage') as TBlobField).SaveToStream(LJPEGStream); // LJPEGStream.Position := 0; LJPEG.LoadFromStream(LJPEGStream); // //Memo1.Text := format('JPEG: %dx%d', [LJPEG.Width, LJPEG.Height]); // if not (LJPEG.Empty) then begin LPrinter := TPrinter.Create; try LPrinter.PrinterIndex := -1; // current printer ( if any one ??? ) LPrinter.Orientation := poPortrait; //TPrinterOrientation(integer(not chkbxPortrait.Checked)); // // try resize to fill the page on printing... MyResizeBitmap2({ } LJPEG, { } LBitmapToResize, { } GetDeviceCaps(LPrinter.Handle, HORZRES), { } GetDeviceCaps(LPrinter.Handle, VERTRES), { } True); //chkbxScaled.Checked); // //Memo1.Lines.Add(format('JPEG loaded: %dx%d', [LJPEG.Width, LJPEG.Height])); // LPrinter.BeginDoc; LPrinter.Canvas.Draw(0, 0, LJPEG); LPrinter.EndDoc; finally LPrinter.Free; end; end; finally LBitmapToResize.Free; LJPEG.Free; LJPEGStream.Free; end; end; Same result. No printing.. Could well be my printer. Ian
-
I was but no longer. No file.
-
Hi Team, I cheated a little bit here and have this att.. procedure TJobTicketsForm.btnPrintImageClick(Sender: TObject); var bmp : TBitmap; jpegimage : TJPegImage; outputrect : TRect; i : Integer; sFilename : string; begin // sFilename := 'TempImage.jpg'; if TFile.Exists(sFileName) then TFile.Delete(sFileName); (dmC.jtImages.FieldByName('JTImage') as TBlobField).SaveToFile(sFilename); // jpegimage := TJPegImage.Create; try jpegimage.Loadfromfile(sFileName); bmp := tbitmap.Create; try bmp.assign(jpegimage); i := 1; while ((i + 1) * bmp.Width < printer.pagewidth) and ((i + 1) * bmp.Height < printer.pageheight) do Inc(i); outputrect := Rect(0, 0, i * bmp.width, i * bmp.height); try printer.Orientation := poPortrait; printer.begindoc; PrintBitmap(bmp, outputrect); except printer.abort; raise; end; printer.enddoc; finally bmp.Free; end; finally jpegimage.free; if TFile.Exists(sFileName) then TFile.Delete(sFileName); end; end; It appears to work. The file is created and it contains the right image. On the disk, TempImage.jpg is only 200KB If I look at the Print Queue it has the file, 38.4MB, ostensibly printing but the printer is doing nothing.. 😞 .
-
Customer is using Win 7. 😞 He also is still using IE and can't change that because of other Legacy applications. 😞