Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set Page Break Preview #1150

Open
MINMINH-log opened this issue Oct 30, 2023 · 6 comments
Open

How to set Page Break Preview #1150

MINMINH-log opened this issue Oct 30, 2023 · 6 comments

Comments

@MINMINH-log
Copy link

MINMINH-log commented Oct 30, 2023

HI. Thanks to you, I am making excel file to download.

But I have an issue.

  1. I uploaded an excel template on "smw0" which has a setting of "PAGE BREAK PREVIEW".
  2. If I download it without abap2xlsx, the setting of page break preview maintains.
  3. However, I have to write on that template and then download.
    in that process, I use abap2xlsx classes, but the setting of page break preview are cleared.
    I don't know why, and I don't know how to solve the problem

Can you help me? it s urgent.

below is the code which has problem:

DATA(ls_key) = VALUE wwwdatatab( relid = 'MI' objid = 'TEMPLATE' ).

CALL FUNCTION 'WWWDATA_IMPORT'
    EXPORTING
      key               = ls_key
    TABLES
      mime              = lt_mime
    EXCEPTIONS
      wrong_object_type = 1
      import_error      = 2
      OTHERS            = 3.

  IF sy-subrc <> 0.
    RETURN.
  ENDIF.

  TRY.
      lv_templ_xstr = cl_bcs_convert=>xtab_to_xstring( lt_mime ).
    CATCH cx_bcs.
      RETURN.
  ENDTRY.

  CREATE OBJECT lo_reader TYPE zcl_excel_reader_2007.
  lo_excel = lo_reader->load( lv_templ_xstr ).

  cl_writer = NEW zcl_excel_writer_2007( ).

  DATA(lv_xstring) = cl_writer->write_file( lo_excel ).

  cl_wd_runtime_services=>attach_file_to_response(
  EXPORTING
    i_filename      = 'test'
    i_content       = lv_xstring
    i_mime_type     = lc_mim_type
     ).
@sandraros
Copy link
Collaborator

Hi.
What is this "page break preview"?
Could you provide the Excel template?
Could you provide a minimal reproducible example? One good recent example of program to reproduce (compiles and runs without effort): https://answers.sap.com/questions/13998912/abap2xlsx-2-worksheets-both-with-method-bind-table.html.

Sorry to hear that you're in a hurry. This is a community tool maintained by volunteers, support is not guaranteed. To increase your chances to get a better support, please be as much precise as possible. I hope you understand.

@MINMINH-log
Copy link
Author

MINMINH-log commented Oct 30, 2023

thanks for your reply!

This is an example of "Page Break Preview". Because of the security policy, i post this alternatively.

Insert, move, or delete page breaks in a worksheet

on the view tab, in the workbook views group, click page break preview.
And then you can see blue line.
I want to set this "blue line".'

@gregorwolf
Copy link
Collaborator

Hi @MINMINH-log ,

can't you just create a sample that doesn't contain any confidential data?

@sandraros sandraros changed the title i want to know how to set Page Break Preview How to set Page Break Preview Oct 31, 2023
@MINMINH-log
Copy link
Author

thank you @gregorwolf @sandraros

can i upload a picture instead?
if you need a file, i will upload a file then.image

@sandraros
Copy link
Collaborator

It's not a matter of file type, it's a matter of data (even images could contain confidential data). I see that it's "empty", i.e. no confidential data/no private data, so could you please attach this "empty" Excel file? I'll then try to reproduce by running the demo program which opens an Excel file and save it (open and save based on the abap2xlsx classes zcl_excel_reader_2007 and zcl_excel_writer_2007).

@MINMINH-log
Copy link
Author

thank you for all of your reply.
But it s hard to send a file that includes a setting of a page break preview.
fortunately, it is determined not to include the setting.
if you know how to set it, then plz comment at here.

thank you: )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants