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

Added Option to export csv between dates #101

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

ufoloko
Copy link
Contributor

@ufoloko ufoloko commented Nov 2, 2022

I have added an option to export to csv for data between two dates.

This works adding a timestamp field for UserDefinedRows table to be able to get records between two dates. This field is automatically populated when new row is added.

If TWO date fields are set in export section, results are filtered, otherwise all records will be exported.

Closes #100

paul_calderon added 2 commits November 2, 2022 20:42

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Copy link
Member

@WillStrohl WillStrohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a fantastic PR. Thank you for taking the time to make the contribution. This is especially true since this module is still using a legacy development pattern. Good stuff! :)

I left a few notes about some minor things, but these minor things could reduce errors later when this is in the next release.

Again, well done.. The DNN community thanks you! :)

</div>
<div class="dnnFormItem">
<dnn:label id="plInitialDate" runat="server" controlname="cbSystemFields" />
<asp:TextBox ID="txtInitialDate" CssClass="NormalTextBox" runat="server" MaxLength="200"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no validation to prevent errors and user experience issues. Also, the readonly attribute should probably be here and not only in the JavaScript, so that it's still readonly if JS is turned off - unless you have a technical reason for that. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ufoloko So you're not able to validate that the value is in a date format or empty? Maybe with a cominbation of Required, Custom, and Range validators to ensure the dates are in sequence and if one is entered, the other needs to be entered or deleted?

var ds = new UserDefinedTableController(_moduleId, TabId, UserInfo).GetDataSet(true);
DataSet ds;

if(initialDate.Length>0 && finalDate.Length > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to be changed, but just as a note for performance for code in general, this might be better done using the built-in string.IsNullOrEmpty() method, because these are string values, and length could return a value greater than zero if there is one or more space values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right. Sorry im not so experienced about how github works, how i can make this change to improve this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries... In the same branch you used to create the PR, just make the update and then push again as a new commit. This will update the PR for you. :) Nothing more is needed.

@valadas
Copy link
Member

valadas commented Dec 11, 2022

@ufoloko @WillStrohl if you want to get our head together to get this merged and do a new release, we are doing open-source co-coding events each Saturday on Discord, you are welcome to join us to get this PR pushed through the finish line and getting a new release out. https://discord.gg/m4RaJWd8

@ufoloko ufoloko requested a review from WillStrohl July 21, 2023 08:20
@ufoloko
Copy link
Contributor Author

ufoloko commented Jul 21, 2023

Finally I have added suggestions you sent. About readonly feature, I need to add that option in client side because if you add that option from server, any change you make in dates is not being saved. I have added the option from server side but adding attributes to fields.

Copy link
Member

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I'll merge and we can iron out anything that crops up in other PRs.

@valadas valadas merged commit 624fe69 into DNNCommunity:development Jul 5, 2024
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

Successfully merging this pull request may close these issues.

Add option to export data between two dates
3 participants