kartik-v / yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)
http://demos.krajee.com/export
Other
165 stars 126 forks source link

DetailView widget export suggestion #339

Open RodrigoDornelles opened 3 years ago

RodrigoDornelles commented 3 years ago

in addition to exporting in the gridview format, I think the variant for only one model is a good implementation (detail wiget)

use kartik\export\DetailExportMenu;
$gridColumns = [
    'id',
    'name',
    'color',
    'publish_date',
    'status',
];

echo DetailView::widget([
    'columns' => $gridColumns,
    'model' => $model
]);

echo DetailExportMenu::widget([
    'columns' => $gridColumns,
    'model' => $model
]);
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/94532113-detailview-widget-export-suggestion?utm_campaign=plugin&utm_content=tracker%2F7668315&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F7668315&utm_medium=issues&utm_source=github).
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

RodrigoDornelles commented 3 years ago

up.

ThreepE0 commented 3 years ago

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

On Sat, Jan 23, 2021 at 3:05 PM RodrigoDornelles notifications@github.com wrote:

up.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766171438, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQHK52KJT3MU6IKSJHTS3MTW5ANCNFSM4TY45FOA .

RodrigoDornelles commented 3 years ago

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

Instead of a table it would be a single record sheet, just like DetailView widget shows the field on the left and the answer on the right.

It would be useful for reporting narrative, reviewing records, researchers, and other types of documents that are organized in this format.

example

ThreepE0 commented 3 years ago

That makes sense. I think that this plugin isn’t suited (and I think maybe shouldn’t be) to that functionality, if I understand the use case correctly.

The plugin is designed for repeating data in a spreadsheet format, where you’re looking for a specific representation of a single model.

This seems like it’s a perfect case for a specific view page using yii’s own functionality; take the standard model view page for example; if you wanted an exportable output for that particular model, create a view for it, and add a button to the grid view or plain view linking to it. If you wanted to spit out html, json, pdf, xml, or whatever, that should be easy enough. You could use a variable in the url/controller action to decide which view gets used, or what format gets offered to the browser for download.

Please let me know if I’m misunderstanding anything. Please note I’m not the developer here, just a fellow user.

On Sun, Jan 24, 2021 at 4:43 PM RodrigoDornelles notifications@github.com wrote:

Use case doesn’t make any sense to me here. It seems like you’d have a single row, which could easily be done by filtering the grid, or trivially in a one-liner (not using yii2-export) to dump model properties and offer a csv to the browser in a model view page. Could you please explain in more detail?

Instead of a table it would be a single record sheet, just like DetailView widget shows the field on the left and the answer on the right.

It would be useful for reporting narrative, reviewing records, researchers, and other types of documents that are organized in this format.

[image: example] https://user-images.githubusercontent.com/29123479/105644367-fcc5bf00-5e73-11eb-93de-601bab1690c3.png

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766437416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQA6OCMFSMZ4WMAGOKLS3SIBTANCNFSM4TY45FOA .

RodrigoDornelles commented 3 years ago

It wouldn't be a necessity of mine, just a suggestion that I thought was a good case.

ThreepE0 commented 3 years ago

I understand, thanks for clarifying

On Sun, Jan 24, 2021 at 5:59 PM RodrigoDornelles notifications@github.com wrote:

It wouldn't be a necessity of mine, just a suggestion that I thought was a good case.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-export/issues/339#issuecomment-766454810, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6OCQEJ5PQLORX2PCECLQ3S3SQ4RANCNFSM4TY45FOA .

gteruel commented 2 years ago

I'm interesred on it but couldn't find the "kartik\export\DetailExportMenu" class anywhere. Any suggestion for its refuge? In addition, some help on how to configure the kartik Export Menu "exportFormView" setting might clarify even more this topic. Thanks in advance.