View Issue Details

IDProjectCategoryView StatusLast Update
0019302LazarusLazReportpublic2011-10-03 10:39
ReporteralexPAssigned ToJesus Reyes 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Platformfpc2.40OSUbuntu 10.04OS Version0.9.29 beta
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0019302: filename error lazreport
DescriptionI write report.filename:= test;
he should to click the save button already have the filename in the filename field savedialog, but it appears blank requiring the User to write again;

the solution is in the code below;

file lr_view.
 
procedure TfrPreviewForm.SaveBtnClick(Sender: TObject);
var
  i: Integer;
  s: String;
begin
  if EMFPages = nil then Exit;
  s := sRepFile + ' (*.frp)|*.frp';
  for i := 0 to frFiltersCount-1 do
    s := s + '|' + frFilters[i].FilterDesc + '|' + frFilters[i].FilterExt;
  with SaveDialog do
  begin
   +++ Filename:=TfrReport(Doc).FileName;
    Filter := s;
    FilterIndex := 2;
    if Execute then
      if FilterIndex = 1 then
        SaveToFile(FileName)
      else
      begin
        ExportToWithFilterIndex(FilterIndex-2,
          ChangeFileExt(FileName, Copy(frFilters[FilterIndex - 2].FilterExt, 2, 255)));
      end;
  end;
end;


as a suggestion should have a filter option to the standard that he indicated to save the selected pattern with that filter ... nobody sends report to customers in the form of strong, but in pdf or html or txt

Steps To Reproducecreate a report and save it before you enter the code below

frReport1.FileName:='teste';
frReport1.PrepareReport;
frReport1.ShowReport;

Then click save and see that the name is blank
TagsNo tags attached.
Fixed in Revision30839
LazTarget0.99.0
WidgetsetGTK 2
Attached Files

Activities

Jesus Reyes

2011-05-21 20:23

developer   ~0048477

Added field ExportFilename to TfrReport specifically for this purpose.

LazReport has support for different exporters, just drop a pdf export filter (or any filter) next to TfrReport then when exporting the export filter will offer you the corresponding filter extension.

What is new is that if ExportFilename is something like teste.pdf (and not just teste) it will choose the right filter.

alexP

2011-06-04 16:25

reporter   ~0048828

Excellent idea to put the extension of the file to set the filter, but my sujestao (do not know if it was already implemented but not found yet in svn) which is added the line (Filename: = TfrReport (Doc). FileName) because So if I set the report name is (sales report date) the name appears in time to save the User option and would change if found necessary.
the button that will display the report:
           frReport1.filename: = test;
          frReport1.PrepareReport;
          frReport1.ShowReport;


add in file lr_view. line (1090) (Filename: = TfrReport (Doc). FileName)

Please add the following line in the location described above and see the difference.

note that the name now appears in savedialog test.

thanks for listening.

Alex

Jesus Reyes

2011-06-25 21:27

developer   ~0049411

While for your application it would be true or necessary that everytime you export a report from the save dialog the same (path and ) filename should appear, it is not so for other applications were if you change the destination folder users will expect the save dialog remember the last used destination folder, if somebody set an absolute path in Filename using, your method, this would not work becuase it will show always that absolute path.

This is the reason why I didn't implement this the you suggested, by using ExportFilename you get both options without limitations, if this do not work for you, please explain the reason, other wise, please close this report.

Felipe Monteiro de Carvalho

2011-10-03 10:39

developer   ~0052423

No further feedback.

Issue History

Date Modified Username Field Change
2011-05-06 21:48 alexP New Issue
2011-05-06 21:48 alexP Widgetset => GTK 2
2011-05-21 19:17 Jesus Reyes Status new => assigned
2011-05-21 19:17 Jesus Reyes Assigned To => Jesus Reyes
2011-05-21 20:23 Jesus Reyes Fixed in Revision => 30839
2011-05-21 20:23 Jesus Reyes LazTarget => 0.99.0
2011-05-21 20:23 Jesus Reyes Status assigned => resolved
2011-05-21 20:23 Jesus Reyes Fixed in Version => 0.9.31 (SVN)
2011-05-21 20:23 Jesus Reyes Resolution open => fixed
2011-05-21 20:23 Jesus Reyes Note Added: 0048477
2011-05-21 20:23 Jesus Reyes Target Version => 0.99.0
2011-06-04 16:25 alexP Status resolved => assigned
2011-06-04 16:25 alexP Resolution fixed => reopened
2011-06-04 16:25 alexP Note Added: 0048828
2011-06-25 21:27 Jesus Reyes Note Added: 0049411
2011-10-03 10:39 Felipe Monteiro de Carvalho Status assigned => resolved
2011-10-03 10:39 Felipe Monteiro de Carvalho Resolution reopened => fixed
2011-10-03 10:39 Felipe Monteiro de Carvalho Note Added: 0052423