Dart Language: printing reports

前端 未结 1 986
难免孤独
难免孤独 2021-01-15 20:15

I would like to know how to print reports on Dart.

Basically, this is the activity flow:

  1. User clicks \"Report\" button.
  2. New b
1条回答
  •  再見小時候
    2021-01-15 21:03

    Update

    Start sending from the report window to window.opener.postMessage(...) and then respond to (message.source as WindowBase).postMessage(...). This is probably a bug with the return value of window.open (see http://dartbug.com/20216 for more details).

    Original

    The code in this unit test should show you how it can be done https://github.com/dart-lang/core-elements/blob/master/test/core_media_query_test.dart.

    I open a window from a new URL that loads its content and a Dart script (can of course also be compiled to JavaScript) from the server. The opened window communicates with the main window by sendMessage. This works in both directions.

    Basically the second window is a second Dart browser application.

    This might not exactly be what you were looking for but your requirement could realized this way I guess.

    At this line https://github.com/dart-lang/core-elements/blob/master/test/core_media_query_test.dart#L66 the commented out code would probably fit for your requirement. I created the workaround below because the code is supposed to resize the second window from code in the main window to test the element (doesn't work either btw.). But I assume you just need to open the window and the commented out code should do exactly that just fine.

    0 讨论(0)
提交回复
热议问题